diff options
author | Robert Speicher <robert@gitlab.com> | 2017-12-15 19:56:15 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-12-15 19:56:15 +0000 |
commit | b540b987648ae6e24bbbc01a7773b2e3209a47b0 (patch) | |
tree | 904ace3d5524eef227976910e136f98925e62371 /config | |
parent | 95f5a525b5a729725d6b559101026b8f39c9c39d (diff) | |
parent | 02994fbe7715ef4539f720b6d395eeb9a3d71f14 (diff) | |
download | gitlab-ce-b540b987648ae6e24bbbc01a7773b2e3209a47b0.tar.gz |
Merge branch 'no-ivar-in-modules' into 'master'
Add cop to make sure we don't use ivar in a module
See merge request gitlab-org/gitlab-ce!12800
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/fix_local_cache_middleware.rb | 2 | ||||
-rw-r--r-- | config/initializers/rspec_profiling.rb | 4 | ||||
-rw-r--r-- | config/initializers/rugged_use_gitlab_git_attributes.rb | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/config/initializers/fix_local_cache_middleware.rb b/config/initializers/fix_local_cache_middleware.rb index cb37f9ed22c..2644ee6a7d3 100644 --- a/config/initializers/fix_local_cache_middleware.rb +++ b/config/initializers/fix_local_cache_middleware.rb @@ -6,7 +6,7 @@ module LocalCacheRegistryCleanupWithEnsure def call(env) LocalCacheRegistry.set_cache_for(local_cache_key, LocalStore.new) - response = @app.call(env) + response = @app.call(env) # rubocop:disable Gitlab/ModuleWithInstanceVariables response[2] = ::Rack::BodyProxy.new(response[2]) do LocalCacheRegistry.set_cache_for(local_cache_key, nil) end diff --git a/config/initializers/rspec_profiling.rb b/config/initializers/rspec_profiling.rb index 16b9d5b15e5..2de310753a9 100644 --- a/config/initializers/rspec_profiling.rb +++ b/config/initializers/rspec_profiling.rb @@ -19,10 +19,10 @@ module RspecProfilingExt def example_finished(*args) super rescue => err - return if @already_logged_example_finished_error + return if @already_logged_example_finished_error # rubocop:disable Gitlab/ModuleWithInstanceVariables $stderr.puts "rspec_profiling couldn't collect an example: #{err}. Further warnings suppressed." - @already_logged_example_finished_error = true + @already_logged_example_finished_error = true # rubocop:disable Gitlab/ModuleWithInstanceVariables end alias_method :example_passed, :example_finished diff --git a/config/initializers/rugged_use_gitlab_git_attributes.rb b/config/initializers/rugged_use_gitlab_git_attributes.rb index 7d652799786..1cfb3bcb4bd 100644 --- a/config/initializers/rugged_use_gitlab_git_attributes.rb +++ b/config/initializers/rugged_use_gitlab_git_attributes.rb @@ -15,8 +15,11 @@ module Rugged class Repository module UseGitlabGitAttributes def fetch_attributes(name, *) + attributes.attributes(name) + end + + def attributes @attributes ||= Gitlab::Git::Attributes.new(path) - @attributes.attributes(name) end end |