Skip to content

Commit

Permalink
rubocop correction
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhoubk committed Apr 10, 2024
1 parent 9484753 commit fb1019b
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ config/master.key
## Environment normalization:
/.bundle
/vendor/bundle

/.local
# these should all be checked in to normalize the environment:
# Gemfile.lock, .ruby-version, .ruby-gemset

Expand Down
168 changes: 164 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ AllCops:
- 'out/**/*'
# Exclude vendor files in GitHub build
- 'vendor/**/*'
NewCops: enable
SuggestExtensions: false

# Allow one line around block body (Layout/EmptyLines will still disallow two or more)
Layout/EmptyLinesAroundBlockBody:
Expand Down Expand Up @@ -345,9 +347,167 @@ Rails/RootJoinChain: # new in 2.13
Enabled: true

# to skip default code generation
Layout/ClassLength:
Metrics/ClassLength:
Enabled: false
Layout/MethodLength:
Metrics/MethodLength:
Enabled: false
Layout/BlockLength:
Enabled: false
Metrics/BlockLength:
Enabled: false

# enable new cops
Gemspec/DevelopmentDependencies: # new in 1.44
Enabled: true
Layout/LineContinuationLeadingSpace: # new in 1.31
Enabled: true
Layout/LineContinuationSpacing: # new in 1.31
Enabled: true
Lint/ConstantOverwrittenInRescue: # new in 1.31
Enabled: true
Lint/DuplicateMagicComment: # new in 1.37
Enabled: true
Lint/DuplicateMatchPattern: # new in 1.50
Enabled: true
Lint/ItWithoutArgumentsInBlock: # new in 1.59
Enabled: true
Lint/LiteralAssignmentInCondition: # new in 1.58
Enabled: true
Lint/MixedCaseRange: # new in 1.53
Enabled: true
Lint/NonAtomicFileOperation: # new in 1.31
Enabled: true
Lint/RedundantRegexpQuantifiers: # new in 1.53
Enabled: true
Lint/RefinementImportMethods: # new in 1.27
Enabled: true
Lint/RequireRangeParentheses: # new in 1.32
Enabled: true
Lint/UselessRescue: # new in 1.43
Enabled: true
Metrics/CollectionLiteralLength: # new in 1.47
Enabled: true
Security/CompoundHash: # new in 1.28
Enabled: true
Style/ArrayIntersect: # new in 1.40
Enabled: false
Style/ComparableClamp: # new in 1.44
Enabled: true
Style/ConcatArrayLiterals: # new in 1.41
Enabled: true
Style/DataInheritance: # new in 1.49
Enabled: true
Style/DirEmpty: # new in 1.48
Enabled: true
Style/EmptyHeredoc: # new in 1.32
Enabled: true
Style/EnvHome: # new in 1.29
Enabled: true
Style/ExactRegexpMatch: # new in 1.51
Enabled: true
Style/FetchEnvVar: # new in 1.28
Enabled: true
Style/FileEmpty: # new in 1.48
Enabled: true
Style/MagicCommentFormat: # new in 1.35
Enabled: true
Style/MapCompactWithConditionalBlock: # new in 1.30
Enabled: true
Style/MapIntoArray: # new in 1.63
Enabled: true
Style/MapToSet: # new in 1.42
Enabled: true
Style/MinMaxComparison: # new in 1.42
Enabled: true
Style/ObjectThen: # new in 1.28
Enabled: true
Style/OperatorMethodCall: # new in 1.37
Enabled: true
Style/RedundantArrayConstructor: # new in 1.52
Enabled: true
Style/RedundantConstantBase: # new in 1.40
Enabled: true
Style/RedundantCurrentDirectoryInPath: # new in 1.53
Enabled: true
Style/RedundantDoubleSplatHashBraces: # new in 1.41
Enabled: true
Style/RedundantEach: # new in 1.38
Enabled: true
Style/RedundantFilterChain: # new in 1.52
Enabled: true
Style/RedundantHeredocDelimiterQuotes: # new in 1.45
Enabled: true
Style/RedundantInitialize: # new in 1.27
Enabled: true
Style/RedundantLineContinuation: # new in 1.49
Enabled: true
Style/RedundantRegexpArgument: # new in 1.53
Enabled: true
Style/RedundantRegexpConstructor: # new in 1.52
Enabled: true
Style/RedundantStringEscape: # new in 1.37
Enabled: true
Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
Enabled: true
Style/SingleLineDoEndBlock: # new in 1.57
Enabled: true
Style/SuperWithArgsParentheses: # new in 1.58
Enabled: true
Style/YAMLFileRead: # new in 1.53
Enabled: true
Rails/ActionControllerFlashBeforeRender: # new in 2.16
Enabled: true
Rails/ActionControllerTestCase: # new in 2.14
Enabled: true
Rails/ActionOrder: # new in 2.17
Enabled: true
Rails/ActiveSupportOnLoad: # new in 2.16
Enabled: true
Rails/DangerousColumnNames: # new in 2.21
Enabled: true
Rails/DeprecatedActiveModelErrorsMethods: # new in 2.14
Enabled: true
Rails/DotSeparatedKeys: # new in 2.15
Enabled: true
Rails/DuplicateAssociation: # new in 2.14
Enabled: true
Rails/DuplicateScope: # new in 2.14
Enabled: true
Rails/EnvLocal: # new in 2.22
Enabled: true
Rails/FreezeTime: # new in 2.16
Enabled: true
Rails/I18nLazyLookup: # new in 2.14
Enabled: true
Rails/I18nLocaleTexts: # new in 2.14
Enabled: false
Rails/IgnoredColumnsAssignment: # new in 2.17
Enabled: true
Rails/MigrationClassName: # new in 2.14
Enabled: true
Rails/RedundantActiveRecordAllMethod: # new in 2.21
Enabled: true
Rails/ResponseParsedBody: # new in 2.18
Enabled: true
Rails/RootPathnameMethods: # new in 2.16
Enabled: true
Rails/RootPublicPath: # new in 2.15
Enabled: true
Rails/SelectMap: # new in 2.21
Enabled: true
Rails/StripHeredoc: # new in 2.15
Enabled: true
Rails/ThreeStateBooleanColumn: # new in 2.19
Enabled: true
Rails/ToFormattedS: # new in 2.15
Enabled: true
Rails/ToSWithArgument: # new in 2.16
Enabled: true
Rails/TopLevelHashWithIndifferentAccess: # new in 2.16
Enabled: true
Rails/TransactionExitStatement: # new in 2.14
Enabled: true
Rails/UnusedRenderContent: # new in 2.21
Enabled: true
Rails/WhereMissing: # new in 2.16
Enabled: true
Rails/WhereNotWithMultipleConditions: # new in 2.17
Enabled: true
1 change: 0 additions & 1 deletion app/controllers/omniauth_callbacks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def calnet
redirect_to root_path
end


private

def calnet_sign_in
Expand Down
4 changes: 2 additions & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
port: 587,
domain: 'berkeley.edu',
user_name: ENV['MAIL_USERNAME'] || '[email protected]',
password: ENV['MAIL_PASSWORD'],
password: ENV.fetch('MAIL_PASSWORD', nil),
authentication: 'plain',
enable_starttls_auto: true
}
Expand All @@ -92,7 +92,7 @@
config.active_support.report_deprecations = :notify

# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
config.log_formatter = Logger::Formatter.new

# Use a different logger for distributed setups.
# require "syslog/logger"
Expand Down
2 changes: 0 additions & 2 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@
logout_url: '/cas/logout',
service_validate_url: '/cas/p3/serviceValidate'



# If you want to use other strategies, that are not supported by Devise, or
# change the failure app, you can configure them inside the config.warden block.
#
Expand Down

0 comments on commit fb1019b

Please sign in to comment.