Skip to content

Commit

Permalink
Merge pull request #69 from riboseinc/ribose-jeffreylau-49-compact
Browse files Browse the repository at this point in the history
rubocop: Enable Style/CollectionCompact for consistent nil checks
  • Loading branch information
ribose-jeffreylau authored Nov 9, 2023
2 parents 5c4946d + c2c6ae5 commit af460e8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ci/rubocop.rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,11 @@ Metrics/PerceivedComplexity:
reader.
Enabled: true
Max: 7
Style/CollectionCompact:
Description: Checks for places where custom logic on rejection nils from arrays
and hashes can be replaced with {Array,Hash}#{compact,compact!}.
StyleGuide: https://docs.rubocop.org/rubocop/cops_style.html#stylecollectioncompact
Enabled: true
Style/ArgumentsForwarding:
Enabled: true
Gemspec/RequireMFA:
Expand Down
5 changes: 5 additions & 0 deletions ci/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,11 @@ Metrics/PerceivedComplexity:
reader.
Enabled: true
Max: 7
Style/CollectionCompact:
Description: Checks for places where custom logic on rejection nils from arrays
and hashes can be replaced with {Array,Hash}#{compact,compact!}.
StyleGuide: https://docs.rubocop.org/rubocop/cops_style.html#stylecollectioncompact
Enabled: true
Style/ArgumentsForwarding:
Enabled: true
Gemspec/RequireMFA:
Expand Down
6 changes: 6 additions & 0 deletions src/rubocop/rubocop.ribose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ Metrics/PerceivedComplexity:
reader.
Enabled: true
Max: 7

Style/CollectionCompact:
Description: Checks for places where custom logic on rejection nils from arrays and hashes can be replaced with {Array,Hash}#{compact,compact!}.
StyleGuide: https://docs.rubocop.org/rubocop/cops_style.html#stylecollectioncompact
Enabled: true

Style/CollectionMethods:
Enabled: false
Style/TrailingCommaInArguments:
Expand Down

0 comments on commit af460e8

Please sign in to comment.