Skip to content

Commit

Permalink
Add new rubocop rules
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jan 30, 2025
1 parent 7836ff5 commit 4ed0748
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 13 deletions.
78 changes: 66 additions & 12 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ require:

AllCops:
Exclude:
- 'Guardfile'
- 'Rakefile'
- 'bin/**/*'
- 'config/**/*'
- 'spec/fixtures/**/*'
- 'vendor/**/*'
- 'node_modules/**/*'
- "Guardfile"
- "Rakefile"
- "bin/**/*"
- "config/**/*"
- "spec/fixtures/**/*"
- "vendor/**/*"
- "node_modules/**/*"
TargetRubyVersion: 3.1

Rails:
Expand All @@ -30,20 +30,20 @@ Style/StringLiterals:
Layout/LineLength:
Max: 120
Exclude:
- 'spec/**/*'
- "spec/**/*"

Lint/MissingSuper:
Exclude:
- 'app/components/**/*'
- "app/components/**/*"

Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- "spec/**/*"

Metrics/ParameterLists:
Max: 6
Exclude:
- 'spec/rails_helper.rb'
- "spec/rails_helper.rb"

RSpec/MultipleExpectations:
Enabled: false
Expand Down Expand Up @@ -517,4 +517,58 @@ RSpec/RemoveConst: # new in 2.26
RSpec/RepeatedSubjectCall: # new in 2.27
Enabled: true
RSpec/UndescriptiveLiteralsDescription: # new in 2.29
Enabled: true
Enabled: true
Gemspec/AddRuntimeDependency: # new in 1.65
Enabled: true
Lint/ConstantReassignment: # new in 1.70
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/SharedMutableDefault: # new in 1.70
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/ItAssignment: # new in 1.70
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
Style/SendWithLiteralMethodName: # new in 1.64
Enabled: true
Style/SuperArguments: # new in 1.64
Enabled: true
Rails/EnumSyntax: # new in 2.26
Enabled: true
Rails/MultipleRoutePaths: # new in 2.29
Enabled: true
Rails/StrongParametersExpect: # new in 2.29
Enabled: true
Rails/WhereRange: # new in 2.25
Enabled: true
Performance/StringBytesize: # new in 1.23
Enabled: true
RSpec/StringAsInstanceDoubleConstant: # new in 3.1
Enabled: true
2 changes: 1 addition & 1 deletion lib/bcp47/record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def self.parse(record_string)
record_string
.gsub(FOLDED_LINE, ' ')
.split("\n")
.filter_map { |line| FIELD_PATTERN.match(line)&.named_captures&.slice('field_name', 'field_body')&.values }
.filter_map { |line| FIELD_PATTERN.match(line)&.named_captures&.slice('field_name', 'field_body')&.values } # rubocop:disable Style/SafeNavigationChainLength
)
end

Expand Down

0 comments on commit 4ed0748

Please sign in to comment.