Skip to content

Commit

Permalink
Merge pull request #1936 from sul-dlss/rubocop
Browse files Browse the repository at this point in the history
Add new rubocop rules
  • Loading branch information
corylown authored Jan 14, 2025
2 parents ffd563c + 1d37200 commit ba1b149
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 11 deletions.
66 changes: 66 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,69 @@ Rails/WhereNotWithMultipleConditions: # new in 2.17
Enabled: true
Rails/WhereRange: # new in 2.25
Enabled: true
Gemspec/AddRuntimeDependency: # new in 1.65
Enabled: true
Lint/DuplicateSetElement: # new in 1.67
Enabled: true
Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69
Enabled: true
Lint/NumericOperationWithConstantResult: # new in 1.69
Enabled: true
Lint/UnescapedBracketInRegexp: # new in 1.68
Enabled: true
Lint/UselessDefined: # new in 1.69
Enabled: true
Lint/UselessNumericOperation: # new in 1.66
Enabled: true
Style/AmbiguousEndlessMethodDefinition: # new in 1.68
Enabled: true
Style/BitwisePredicate: # new in 1.68
Enabled: true
Style/CombinableDefined: # new in 1.68
Enabled: true
Style/DigChain: # new in 1.69
Enabled: true
Style/FileNull: # new in 1.69
Enabled: true
Style/FileTouch: # new in 1.69
Enabled: true
Style/KeywordArgumentsMerging: # new in 1.68
Enabled: true
Style/RedundantInterpolationUnfreeze: # new in 1.66
Enabled: true
Style/SafeNavigationChainLength: # new in 1.68
Enabled: true
Performance/StringBytesize: # new in 1.23
Enabled: true
Rails/EnumSyntax: # new in 2.26
Enabled: true
RSpec/StringAsInstanceDoubleConstant: # new in 3.1
Enabled: true
FactoryBot/AssociationStyle: # new in 2.23
Enabled: true
FactoryBot/ConsistentParenthesesStyle: # new in 2.14
Enabled: true
FactoryBot/ExcessiveCreateList: # new in 2.25
Enabled: true
FactoryBot/FactoryAssociationWithStrategy: # new in 2.23
Enabled: true
FactoryBot/FactoryNameStyle: # new in 2.16
Enabled: true
FactoryBot/IdSequence: # new in 2.24
Enabled: true
FactoryBot/RedundantFactoryOption: # new in 2.23
Enabled: true
FactoryBot/SyntaxMethods: # new in 2.7
Enabled: true
RSpecRails/AvoidSetupHook: # new in 2.4
Enabled: true
RSpecRails/HaveHttpStatus: # new in 2.12
Enabled: true
RSpecRails/InferredSpecType: # new in 2.14
Enabled: true
RSpecRails/MinitestAssertions: # new in 2.17
Enabled: true
RSpecRails/NegationBeValid: # new in 2.23
Enabled: true
RSpecRails/TravelAround: # new in 2.19
Enabled: true
30 changes: 19 additions & 11 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-06-17 18:36:49 UTC using RuboCop version 1.64.1.
# on 2025-01-10 18:06:58 UTC using RuboCop version 1.69.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -16,6 +16,14 @@ Capybara/RSpec/HaveSelector:
- 'spec/components/owner_field_component_spec.rb'
- 'spec/requests/contributors_spec.rb'

# Offense count: 2
# Configuration parameters: Include, MaxAmount.
# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb
FactoryBot/ExcessiveCreateList:
Exclude:
- 'spec/controllers/transform_results_controller_spec.rb'
- 'spec/requests/transform_result_spec.rb'

# Offense count: 2
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Expand All @@ -38,14 +46,6 @@ Naming/MethodParameterName:
Exclude:
- 'app/models/dlme_json.rb'

# Offense count: 16
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
# SupportedStyles: snake_case, normalcase, non_integer
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
Naming/VariableNumber:
Exclude:
- 'spec/features/bulk_resource_delete_spec.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
Expand All @@ -72,11 +72,10 @@ RSpec/ExpectChange:
Exclude:
- 'spec/controllers/dlme_jsons_controller_spec.rb'

# Offense count: 18
# Offense count: 2
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
RSpec/IndexedLet:
Exclude:
- 'spec/features/bulk_resource_delete_spec.rb'
- 'spec/models/statistics_dashboard_spec.rb'

# Offense count: 12
Expand Down Expand Up @@ -139,6 +138,15 @@ Style/ReturnNilInPredicateMethodDefinition:
Exclude:
- 'app/models/solr_document.rb'

# Offense count: 4
# Configuration parameters: Max.
Style/SafeNavigationChainLength:
Exclude:
- 'app/processors/autolink.rb'
- 'app/processors/bidi_wrap.rb'
- 'app/processors/collapse.rb'
- 'app/processors/paragraph.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SingleArgumentDig:
Expand Down

0 comments on commit ba1b149

Please sign in to comment.