Commit 3b753373 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'rubocop-performance-openstruct-guardfile' into 'master'

Fix the Style/OpenStructUse Cop offense for Guardfile

See merge request gitlab-org/gitlab!65386
parents c513f4fd 527474d6
......@@ -2558,7 +2558,6 @@ Rails/IncludeUrlHelper:
# TODO issue: https://gitlab.com/gitlab-org/gitlab/-/issues/344279
Style/OpenStructUse:
Exclude:
- 'Guardfile'
- 'app/finders/snippets_finder.rb'
- 'app/helpers/application_settings_helper.rb'
- 'ee/lib/gitlab/graphql/aggregations/epics/epic_node.rb'
......
......@@ -9,7 +9,7 @@ cmd = ENV['GUARD_CMD'] || (ENV['SPRING'] ? 'spring rspec' : 'bundle exec rspec')
directories %w(app ee lib rubocop tooling spec)
rspec_context_for = proc do |context_path|
OpenStruct.new(to_s: "spec").tap do |rspec|
OpenStruct.new(to_s: "spec").tap do |rspec| # rubocop:disable Style/OpenStructUse
rspec.spec_dir = "#{context_path}spec"
rspec.spec = ->(m) { Guard::RSpec::Dsl.detect_spec_file_for(rspec, m) }
rspec.spec_helper = "#{rspec.spec_dir}/spec_helper.rb"
......@@ -19,7 +19,7 @@ rspec_context_for = proc do |context_path|
end
rails_context_for = proc do |context_path, exts|
OpenStruct.new.tap do |rails|
OpenStruct.new.tap do |rails| # rubocop:disable Style/OpenStructUse
rails.app_files = %r{^#{context_path}app/(.+)\.rb$}
rails.views = %r{^#{context_path}app/(views/.+/[^/]*\.(?:#{exts}))$}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment