Use default: ... assignment for Devise config, fixes Style/ClassVars cop (#30214)

This commit is contained in:
Matt Jankowski 2024-05-10 05:42:01 -04:00 committed by GitHub
parent c9557bdd3b
commit 040aaf3a48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 38 deletions

View file

@ -54,10 +54,6 @@ Style/ClassEqualityComparison:
- 'app/helpers/jsonld_helper.rb' - 'app/helpers/jsonld_helper.rb'
- 'app/serializers/activitypub/outbox_serializer.rb' - 'app/serializers/activitypub/outbox_serializer.rb'
Style/ClassVars:
Exclude:
- 'config/initializers/devise.rb'
# This cop supports safe autocorrection (--autocorrect). # This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedVars. # Configuration parameters: AllowedVars.
Style/FetchEnvVar: Style/FetchEnvVar:

View file

@ -38,42 +38,25 @@ Warden::Manager.before_logout do |_, warden|
end end
module Devise module Devise
mattr_accessor :pam_authentication mattr_accessor :pam_authentication, default: false
@@pam_authentication = false mattr_accessor :pam_controlled_service, default: nil
mattr_accessor :pam_controlled_service
@@pam_controlled_service = nil
mattr_accessor :check_at_sign mattr_accessor :check_at_sign, default: false
@@check_at_sign = false
mattr_accessor :ldap_authentication mattr_accessor :ldap_authentication, default: false
@@ldap_authentication = false mattr_accessor :ldap_host, default: nil
mattr_accessor :ldap_host mattr_accessor :ldap_port, default: nil
@@ldap_host = nil mattr_accessor :ldap_method, default: nil
mattr_accessor :ldap_port mattr_accessor :ldap_base, default: nil
@@ldap_port = nil mattr_accessor :ldap_uid, default: nil
mattr_accessor :ldap_method mattr_accessor :ldap_mail, default: nil
@@ldap_method = nil mattr_accessor :ldap_bind_dn, default: nil
mattr_accessor :ldap_base mattr_accessor :ldap_password, default: nil
@@ldap_base = nil mattr_accessor :ldap_tls_no_verify, default: false
mattr_accessor :ldap_uid mattr_accessor :ldap_search_filter, default: nil
@@ldap_uid = nil mattr_accessor :ldap_uid_conversion_enabled, default: false
mattr_accessor :ldap_mail mattr_accessor :ldap_uid_conversion_search, default: nil
@@ldap_mail = nil mattr_accessor :ldap_uid_conversion_replace, default: nil
mattr_accessor :ldap_bind_dn
@@ldap_bind_dn = nil
mattr_accessor :ldap_password
@@ldap_password = nil
mattr_accessor :ldap_tls_no_verify
@@ldap_tls_no_verify = false
mattr_accessor :ldap_search_filter
@@ldap_search_filter = nil
mattr_accessor :ldap_uid_conversion_enabled
@@ldap_uid_conversion_enabled = false
mattr_accessor :ldap_uid_conversion_search
@@ldap_uid_conversion_search = nil
mattr_accessor :ldap_uid_conversion_replace
@@ldap_uid_conversion_replace = nil
module Strategies module Strategies
class PamAuthenticatable class PamAuthenticatable