Skip to content

Commit

Permalink
rubocop: Add more Lint/* checks
Browse files Browse the repository at this point in the history
See: #42
  • Loading branch information
ribose-jeffreylau committed Nov 9, 2023
1 parent af460e8 commit e2bff59
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ci/rubocop.rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,23 @@ Performance/StringReplacement:
characters. Use `delete` instead of `gsub` when you are deleting characters.
Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
Enabled: false
Lint/DuplicateBranch:
Enabled: true
Lint/EmptyBlock:
Enabled: true
Lint/EmptyClass:
Enabled: true
Lint/NoReturnInBeginEndBlocks:
Enabled: true
Lint/ShadowedArgument:
Enabled: true
IgnoreImplicitReferences: true
Lint/ToEnumArguments:
Enabled: true
Lint/UnexpectedBlockArity:
Enabled: true
Lint/UnmodifiedReduceAccumulator:
Enabled: true
Metrics/PerceivedComplexity:
Description: A complexity metric geared towards measuring complexity for a human
reader.
Expand Down
14 changes: 14 additions & 0 deletions ci/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,23 @@ Performance/StringReplacement:
characters. Use `delete` instead of `gsub` when you are deleting characters.
Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
Enabled: false
Lint/DuplicateBranch:
Enabled: true
Lint/EmptyBlock:
Enabled: true
Lint/EmptyClass:
Enabled: true
Lint/NoReturnInBeginEndBlocks:
Enabled: true
Lint/ShadowedArgument:
Enabled: true
IgnoreImplicitReferences: true
Lint/ToEnumArguments:
Enabled: true
Lint/UnexpectedBlockArity:
Enabled: true
Lint/UnmodifiedReduceAccumulator:
Enabled: true
Metrics/PerceivedComplexity:
Description: A complexity metric geared towards measuring complexity for a human
reader.
Expand Down
27 changes: 27 additions & 0 deletions src/rubocop/rubocop.ribose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ AllCops:
DisplayCopNames: false
StyleGuideCopsOnly: false
TargetRubyVersion: 3.1

Lint/DuplicateBranch: # (new in 1.3)
Enabled: true

Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
Enabled: true

Lint/EmptyBlock: # (new in 1.1)
Enabled: true

Lint/EmptyClass: # (new in 1.3)
Enabled: true

Layout/LineLength:
Description: Limit lines to 80 characters.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
Expand All @@ -15,9 +28,23 @@ Layout/LineLength:
URISchemes:
- http
- https

Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
Enabled: true

Lint/ShadowedArgument:
Enabled: true
IgnoreImplicitReferences: true

Lint/ToEnumArguments: # (new in 1.1)
Enabled: true

Lint/UnexpectedBlockArity: # (new in 1.5)
Enabled: true

Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
Enabled: true

Metrics/AbcSize:
Description: A calculated magnitude based on number of assignments, branches, and
conditions.
Expand Down

0 comments on commit e2bff59

Please sign in to comment.