Commit 72373bf5 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Rémy Coutable

Fix Style/AccessModifierDeclarations cop

MR fixes the cop for the files

Adds changelog for change
parent 0422c4a6
...@@ -60,6 +60,9 @@ Style/MutableConstant: ...@@ -60,6 +60,9 @@ Style/MutableConstant:
Style/SafeNavigation: Style/SafeNavigation:
Enabled: false Enabled: false
Style/AccessModifierDeclarations:
AllowModifiersOnSymbols: true
# Frozen String Literal # Frozen String Literal
Style/FrozenStringLiteralComment: Style/FrozenStringLiteralComment:
Enabled: true Enabled: true
......
...@@ -498,17 +498,6 @@ Security/YAMLLoad: ...@@ -498,17 +498,6 @@ Security/YAMLLoad:
- 'spec/initializers/secret_token_spec.rb' - 'spec/initializers/secret_token_spec.rb'
- 'spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb' - 'spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb'
# Offense count: 10
# Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols.
# SupportedStyles: inline, group
Style/AccessModifierDeclarations:
Exclude:
- 'app/helpers/issues_helper.rb'
- 'app/helpers/lazy_image_tag_helper.rb'
- 'lib/gitlab/cache/request_cache.rb'
- 'lib/gitlab/request_profiler.rb'
- 'spec/support/forgery_protection.rb'
# Offense count: 148 # Offense count: 148
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
......
...@@ -25,5 +25,5 @@ module LazyImageTagHelper ...@@ -25,5 +25,5 @@ module LazyImageTagHelper
end end
# Required for Banzai::Filter::ImageLazyLoadFilter # Required for Banzai::Filter::ImageLazyLoadFilter
module_function :placeholder_image module_function :placeholder_image # rubocop: disable Style/AccessModifierDeclarations
end end
---
title: Fix Style/AccessModifierDeclarations co cop
merge_request: 41252
author: Rajendra Kadam
type: fixed
...@@ -55,7 +55,7 @@ module Gitlab ...@@ -55,7 +55,7 @@ module Gitlab
.join(':') .join(':')
end end
private cache_key_method_name private cache_key_method_name # rubocop: disable Style/AccessModifierDeclarations
end end
end end
end end
......
...@@ -11,7 +11,7 @@ module Gitlab ...@@ -11,7 +11,7 @@ module Gitlab
Profile.new(File.basename(path)) Profile.new(File.basename(path))
end.select(&:valid?) end.select(&:valid?)
end end
module_function :all module_function :all # rubocop: disable Style/AccessModifierDeclarations
def find(name) def find(name)
file_path = File.join(PROFILES_DIR, name) file_path = File.join(PROFILES_DIR, name)
...@@ -19,18 +19,18 @@ module Gitlab ...@@ -19,18 +19,18 @@ module Gitlab
Profile.new(name) Profile.new(name)
end end
module_function :find module_function :find # rubocop: disable Style/AccessModifierDeclarations
def profile_token def profile_token
Rails.cache.fetch('profile-token') do Rails.cache.fetch('profile-token') do
Devise.friendly_token Devise.friendly_token
end end
end end
module_function :profile_token module_function :profile_token # rubocop: disable Style/AccessModifierDeclarations
def remove_all_profiles def remove_all_profiles
FileUtils.rm_rf(PROFILES_DIR) FileUtils.rm_rf(PROFILES_DIR)
end end
module_function :remove_all_profiles module_function :remove_all_profiles # rubocop: disable Style/AccessModifierDeclarations
end end
end end
...@@ -8,7 +8,7 @@ module ForgeryProtection ...@@ -8,7 +8,7 @@ module ForgeryProtection
ActionController::Base.allow_forgery_protection = false ActionController::Base.allow_forgery_protection = false
end end
module_function :with_forgery_protection module_function :with_forgery_protection # rubocop: disable Style/AccessModifierDeclarations
end end
RSpec.configure do |config| RSpec.configure do |config|
......
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