Skip to content

Commit

Permalink
Move rubocop config to the rails folder (thewca#7717)
Browse files Browse the repository at this point in the history
* Move rubocop config to the rails folder

* Manually specify rubocop config file location in pre commit hook
  • Loading branch information
simonkellly authored Mar 6, 2023
1 parent 0d37c8e commit d10b1d0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
1 change: 1 addition & 0 deletions .overcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ PreCommit:

RuboCop:
enabled: true
command: ['bundle', 'exec', 'rubocop', '--config', './WcaOnRails/.rubocop.yml']
on_warn: fail # Treat all warnings as failures

IllegalStrings:
Expand Down
14 changes: 7 additions & 7 deletions .rubocop.yml → WcaOnRails/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ AllCops:
DisplayCopNames: true
NewCops: enable
Exclude:
- 'WcaOnRails/node_modules/**/*'
- 'WcaOnRails/bin/**/*'
- 'WcaOnRails/vendor/**/*'
- 'node_modules/**/*'
- 'bin/**/*'
- 'vendor/**/*'
# This file is provided as-is by Discourse
- 'WcaOnRails/lib/single_sign_on.rb'
- 'lib/single_sign_on.rb'

Bundler/OrderedGems:
Enabled: false
Expand Down Expand Up @@ -201,7 +201,7 @@ Layout/EmptyLineAfterGuardClause:

Lint/EmptyFile:
Exclude:
- 'WcaOnRails/db/seeds.rb'
- 'db/seeds.rb'

# We have too many event IDs and Comp Years with numbers in them
Naming/VariableNumber:
Expand All @@ -211,11 +211,11 @@ Naming/VariableNumber:
# we have no choice but to follow their conventions until they update
Naming/InclusiveLanguage:
Exclude:
- 'WcaOnRails/config/**/*'
- 'config/**/*'

Style/OpenStructUse:
Exclude:
- 'WcaOnRails/spec/lib/middlewares/warden_user_logger_spec.rb'
- 'spec/lib/middlewares/warden_user_logger_spec.rb'

Style/HashSyntax:
EnforcedShorthandSyntax: never
30 changes: 15 additions & 15 deletions .rubocop_todo.yml → WcaOnRails/.rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
# SupportedStyles: snake_case, camelCase
Naming/MethodName:
Exclude:
- 'WcaOnRails/app/controllers/users_controller.rb'
- 'WcaOnRails/app/models/light_result.rb'
- 'WcaOnRails/app/models/event.rb'
- 'WcaOnRails/app/models/round_type.rb'
- 'WcaOnRails/db/migrate/20160109070723_convert_process_links_format_to_markdown.rb'
- 'app/controllers/users_controller.rb'
- 'app/models/light_result.rb'
- 'app/models/event.rb'
- 'app/models/round_type.rb'
- 'db/migrate/20160109070723_convert_process_links_format_to_markdown.rb'

# Offense count: 16
# Configuration parameters: EnforcedStyle, SupportedStyles.
Expand All @@ -36,19 +36,19 @@ Lint/AmbiguousBlockAssociation:

Metrics/CyclomaticComplexity:
Exclude:
- 'WcaOnRails/app/controllers/competitions_controller.rb'
- 'WcaOnRails/app/controllers/registrations_controller.rb'
- 'WcaOnRails/app/jobs/sync_mailing_lists_job.rb'
- 'WcaOnRails/app/models/competition.rb'
- 'WcaOnRails/lib/results_validators/*.rb'
- 'app/controllers/competitions_controller.rb'
- 'app/controllers/registrations_controller.rb'
- 'app/jobs/sync_mailing_lists_job.rb'
- 'app/models/competition.rb'
- 'lib/results_validators/*.rb'

Metrics/PerceivedComplexity:
Exclude:
- 'WcaOnRails/app/controllers/competitions_controller.rb'
- 'WcaOnRails/app/controllers/registrations_controller.rb'
- 'WcaOnRails/app/jobs/sync_mailing_lists_job.rb'
- 'WcaOnRails/app/models/competition.rb'
- 'WcaOnRails/lib/results_validators/*.rb'
- 'app/controllers/competitions_controller.rb'
- 'app/controllers/registrations_controller.rb'
- 'app/jobs/sync_mailing_lists_job.rb'
- 'app/models/competition.rb'
- 'lib/results_validators/*.rb'

Lint/StructNewOverride:
Enabled: false
Expand Down

0 comments on commit d10b1d0

Please sign in to comment.