Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable more rubocop checks #70

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 53 additions & 1 deletion ci/rubocop.rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -489,20 +489,72 @@ 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.
Enabled: true
Max: 7
Performance/AncestorsInclude:
Enabled: true
Performance/BigDecimalWithNumericArgument:
Enabled: true
Performance/BlockGivenWithExplicitBlock:
Enabled: true
Performance/CollectionLiteralInLoop:
Enabled: true
Performance/MethodObjectAsBlock:
Enabled: true
Performance/RedundantEqualityComparisonBlock:
Enabled: true
Performance/RedundantSortBlock:
Enabled: true
Performance/RedundantSplitRegexpArgument:
Enabled: true
Performance/RedundantStringChars:
Enabled: true
Performance/ReverseFirst:
Enabled: true
Performance/SortReverse:
Enabled: true
Performance/Squeeze:
Enabled: true
Performance/StringInclude:
Enabled: true
Performance/Sum:
Enabled: true
Style/ArgumentsForwarding:
Enabled: true
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:
Style/DocumentDynamicEvalDefinition:
Enabled: true
Style/NegatedIfElseCondition:
Enabled: true
Style/NilLambda:
Enabled: true
Style/RedundantArgument:
Enabled: true
Style/SwapValues:
Enabled: true
Gemspec/RequireMFA:
Enabled: false
Expand Down
54 changes: 53 additions & 1 deletion ci/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -486,20 +486,72 @@ 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.
Enabled: true
Max: 7
Performance/AncestorsInclude:
Enabled: true
Performance/BigDecimalWithNumericArgument:
Enabled: true
Performance/BlockGivenWithExplicitBlock:
Enabled: true
Performance/CollectionLiteralInLoop:
Enabled: true
Performance/MethodObjectAsBlock:
Enabled: true
Performance/RedundantEqualityComparisonBlock:
Enabled: true
Performance/RedundantSortBlock:
Enabled: true
Performance/RedundantSplitRegexpArgument:
Enabled: true
Performance/RedundantStringChars:
Enabled: true
Performance/ReverseFirst:
Enabled: true
Performance/SortReverse:
Enabled: true
Performance/Squeeze:
Enabled: true
Performance/StringInclude:
Enabled: true
Performance/Sum:
Enabled: true
Style/ArgumentsForwarding:
Enabled: true
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:
Style/DocumentDynamicEvalDefinition:
Enabled: true
Style/NegatedIfElseCondition:
Enabled: true
Style/NilLambda:
Enabled: true
Style/RedundantArgument:
Enabled: true
Style/SwapValues:
Enabled: true
Gemspec/RequireMFA:
Enabled: false
93 changes: 92 additions & 1 deletion 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 Expand Up @@ -62,13 +89,77 @@ Metrics/PerceivedComplexity:
Enabled: true
Max: 7

Style/CollectionCompact:
Performance/AncestorsInclude: # (new in 1.7)
Enabled: true

Performance/BigDecimalWithNumericArgument: # (new in 1.7)
Enabled: true

Performance/BlockGivenWithExplicitBlock: # (new in 1.9)
Enabled: true

Performance/CollectionLiteralInLoop: # (new in 1.8)
Enabled: true

Performance/ConstantRegexp: # (new in 1.9)
Enabled: true

Performance/MethodObjectAsBlock: # (new in 1.9)
Enabled: true

Performance/RedundantEqualityComparisonBlock: # (new in 1.10)
Enabled: true

Performance/RedundantSortBlock: # (new in 1.7)
Enabled: true

Performance/RedundantSplitRegexpArgument: # (new in 1.10)
Enabled: true

Performance/RedundantStringChars: # (new in 1.7)
Enabled: true

Performance/ReverseFirst: # (new in 1.7)
Enabled: true

Performance/SortReverse: # (new in 1.7)
Enabled: true

Performance/Squeeze: # (new in 1.7)
Enabled: true

Performance/StringInclude: # (new in 1.7)
Enabled: true

Performance/Sum: # (new in 1.8)
Enabled: true

Style/ArgumentsForwarding: # (new in 1.1)
Enabled: true

Style/CollectionCompact: # (new in 1.2)
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/DocumentDynamicEvalDefinition: # (new in 1.1)
Enabled: true

Style/NegatedIfElseCondition: # (new in 1.2)
Enabled: true

Style/NilLambda: # (new in 1.3)
Enabled: true

Style/RedundantArgument: # (new in 1.4)
Enabled: true

Style/SwapValues: # (new in 1.1)
Enabled: true

Style/CollectionMethods:
Enabled: false

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma

Expand Down