Skip to content

config/default: Stop disabling all cops by default #117

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

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f874c43
config/default: Stop disabling all cops by default
issyl0 Oct 10, 2022
87eaa0c
config/default: Remove redundant `Enabled: true` for cops
issyl0 Oct 10, 2022
638d418
Autocorrect RuboCop `Layout/EmptyLines` offenses
issyl0 Oct 10, 2022
0ca6227
Autocorrect RuboCop `Layout/SpaceInsideHashLiteralBraces` offenses
issyl0 Oct 10, 2022
f107008
Autocorrect RuboCop `Style/StringConcatenation` offenses
issyl0 Oct 10, 2022
d7ddb57
Autocorrect RuboCop `Style/IfUnlessModifier` offenses
issyl0 Oct 10, 2022
cc0a4b8
config/default: Disable some of the default rules
issyl0 Oct 10, 2022
8d8c578
Configure and autocorrect RuboCop `Style/PercentLiteralDelimiters`
issyl0 Oct 10, 2022
5241eb0
Autocorrect RuboCop `Style/RedundantParentheses` offenses
issyl0 Oct 10, 2022
89ac526
config/default: Disable more rules
issyl0 Oct 10, 2022
51aa7fb
Autocorrect RuboCop \`Style/SafeNavigation\` offenses
issyl0 Oct 10, 2022
401c927
Autocorrect RuboCop `Layout/SpaceAroundOperators` offenses
issyl0 Oct 10, 2022
5ba9ba8
config/default: Disable more rules that the styleguide doesn't opine on
issyl0 Oct 10, 2022
127c051
Autocorrect RuboCop `Layout/EmptyLineAfterGuardClause` offenses
issyl0 Oct 10, 2022
30fe0a5
Autocorrect RuboCop `Layout/RedundantLineBreak` offenses
issyl0 Oct 10, 2022
be167bb
Fix RuboCop `Naming/MemoizedInstanceVariableName` offenses
issyl0 Oct 10, 2022
9b62169
Autocorrect RuboCop `Style/MultipleComparison` offenses
issyl0 Oct 10, 2022
2672610
Autocorrect RuboCop `Style/{RedundantFreeze,MutableConstants}` offenses
issyl0 Oct 10, 2022
a53163c
Fix RuboCop `Lint/UselessAssignment` offenses
issyl0 Oct 10, 2022
1557c29
config/default: Disable `Lint/AssignmentInCondition` with a big TODO
issyl0 Oct 10, 2022
816ca3a
Merge branch 'master' into rubocop-enabled-by-default
issyl0 Oct 10, 2022
e2b3734
config/default: Unset `EnabledByDefault: true`
issyl0 Oct 10, 2022
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
317 changes: 75 additions & 242 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,183 +2,66 @@ require:
- rubocop/cop/github
- rubocop-performance

AllCops:
DisabledByDefault: true

Bundler/DuplicatedGem:
Enabled: true

Bundler/OrderedGems:
Enabled: true

GitHub/InsecureHashAlgorithm:
Enabled: true
Gemspec/DependencyVersion:
Enabled: false
Comment on lines -8 to +6
Copy link
Member Author

@issyl0 issyl0 Oct 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some of these new ones that fail RuboCop in the code in this gem: should we put them in here, the global config for the gem and the one that all its downstream consumers use, or should we put them in .rubocop.yml inside this repo only?

I guess I'm now concerned, after @bensheldon's comments, about this gem's config not being a reflection of the styleguide? Who gets to make decisions on what we include in the styleguide, and hence who gets to "control" what sensible default RuboCop configuration we send out into the world?


Layout/BlockAlignment:
Enabled: true
# TODO: This is too new to be written in the styleguide.
Gemspec/RequireMFA:
Enabled: false

Layout/BlockEndNewline:
Enabled: true
Gemspec/RequiredRubyVersion:
Enabled: false

Layout/ConditionPosition:
Enabled: true
# TOOD: This seems arbitrary, but we don't have a styleguide opinion on it?
Layout/ClassStructure:
Enabled: false

Layout/DefEndAlignment:
Enabled: true
Layout/EmptyLineAfterMagicComment:
Enabled: false

Layout/EndAlignment:
Enabled: false

Layout/EndOfLine:
Enabled: true

Layout/IndentationStyle:
Enabled: true
EnforcedStyle: spaces
IndentationWidth: 2

Layout/IndentationWidth:
Enabled: true
Width: 2

Layout/InitialIndentation:
Enabled: true

# TODO: Enable this with line length of 118 (the GitHub UI's text wrapping length)
# since it's specified in https://github.com/github/rubocop-github/blob/master/STYLEGUIDE.md#maximum-line-length.
Layout/LineLength:
Enabled: false

Layout/SpaceAfterColon:
Enabled: true

Layout/SpaceAfterComma:
Enabled: true

Layout/SpaceAfterMethodName:
Enabled: true

Layout/SpaceAfterNot:
Enabled: true

Layout/SpaceAfterSemicolon:
Enabled: true

Layout/SpaceAroundBlockParameters:
Enabled: true

Layout/SpaceAroundEqualsInParameterDefault:
Enabled: true
# TODO: The styleguide has no opinions on this yet.
Layout/MultilineMethodCallIndentation:
Enabled: false

Layout/SpaceBeforeBlockBraces:
Enabled: true
Layout/SingleLineBlockChain:
Enabled: false

Layout/SpaceInsideArrayLiteralBrackets:
Enabled: true
EnforcedStyle: no_space

Layout/SpaceInsideArrayPercentLiteral:
Enabled: true

Layout/SpaceInsideBlockBraces:
Enabled: true

Layout/SpaceInsideParens:
Enabled: true

Layout/SpaceInsideRangeLiteral:
Enabled: true

Layout/SpaceInsideReferenceBrackets:
Enabled: true

Layout/TrailingEmptyLines:
Enabled: true

Layout/TrailingWhitespace:
Enabled: true

Lint/CircularArgumentReference:
Enabled: true

Lint/Debugger:
Enabled: true

Lint/DeprecatedClassMethods:
Enabled: true

Lint/DuplicateMethods:
Enabled: true

Lint/DuplicateHashKey:
Enabled: true

Lint/EachWithObjectArgument:
Enabled: true

Lint/ElseLayout:
Enabled: true

Lint/EmptyEnsure:
Enabled: true

Lint/EmptyInterpolation:
Enabled: true

Lint/EnsureReturn:
Enabled: true

Lint/FlipFlop:
Enabled: true

Lint/FloatOutOfRange:
Enabled: true

Lint/FormatParameterMismatch:
Enabled: true

Lint/LiteralAsCondition:
Enabled: true

Lint/LiteralInInterpolation:
Enabled: true

Lint/Loop:
Enabled: true

Lint/NextWithoutAccumulator:
Enabled: true

Lint/RandOne:
Enabled: true

Lint/RequireParentheses:
Enabled: true

Lint/RescueException:
Enabled: true

Lint/RedundantStringCoercion:
Enabled: true

Lint/UnderscorePrefixedVariableName:
Enabled: true

Lint/RedundantCopDisableDirective:
Enabled: true
# TODO: Absolutely we should enable this one, but it's very noisy right now.
Lint/AssignmentInCondition:
Enabled: false

Lint/RedundantSplatExpansion:
Enabled: true
Lint/ConstantResolution:
Enabled: false

Lint/UnreachableCode:
Enabled: true
Lint/DuplicateBranch:
Enabled: false

Lint/BinaryOperatorWithIdenticalOperands:
Enabled: true
Lint/EmptyConditionalBody:
Enabled: false

Lint/UselessSetterCall:
Enabled: true
Lint/NumberConversion:
Enabled: false

Lint/Void:
Enabled: true
Lint/UnusedBlockArgument:
Enabled: false

Metrics/AbcSize:
Enabled: false
Expand Down Expand Up @@ -207,128 +90,78 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Enabled: false

Naming/AsciiIdentifiers:
Enabled: true

Naming/ClassAndModuleCamelCase:
Enabled: true

Naming/FileName:
Enabled: true

Naming/MethodName:
Enabled: true

Performance/CaseWhenSplat:
Enabled: false

Performance/Count:
Enabled: true

Performance/Detect:
Enabled: true

Performance/DoubleStartEndWith:
Enabled: true

Performance/EndWith:
Enabled: true

Performance/FlatMap:
Enabled: true

Performance/RangeInclude:
Enabled: false

Performance/RedundantMatch:
Performance/ChainArrayAllocation:
Enabled: false

Performance/RedundantMerge:
Enabled: true
MaxKeyValuePairs: 1

Performance/ReverseEach:
Enabled: true

Performance/Size:
Enabled: true

Performance/StartWith:
Enabled: true

Security/Eval:
Enabled: true

Style/ArrayJoin:
Enabled: true

Style/BeginBlock:
Enabled: true

Style/BlockComments:
Enabled: true

Style/CaseEquality:
Enabled: true

Style/CharacterLiteral:
Enabled: true
Style/CollectionMethods:
Enabled: false

Style/ClassMethods:
Enabled: true
Style/ConstantVisibility:
Enabled: false

Style/Copyright:
Enabled: false

Style/DefWithParentheses:
Enabled: true
# TODO: The styleguide doesn't have an opinion on this yet.
Style/Documentation:
Enabled: false

Style/EndBlock:
Enabled: true
Style/DocumentationMethod:
Enabled: false

Style/For:
Enabled: true
Style/EmptyCaseCondition:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: true
Style/GuardClause:
Enabled: false

Style/HashSyntax:
Enabled: true
EnforcedStyle: ruby19_no_mixed_keys

Style/LambdaCall:
Enabled: true

Style/MethodCallWithoutArgsParentheses:
Enabled: true
Style/InlineComment:
Enabled: false

Style/MethodDefParentheses:
Enabled: true
Style/MethodCallWithArgsParentheses:
Enabled: false

Style/MultilineIfThen:
Enabled: true
Style/MultilineBlockChain:
Enabled: false

Style/NilComparison:
Enabled: true
Style/MissingElse:
Enabled: false

Style/Not:
Enabled: true
Style/NegatedIf:
Enabled: false

Style/OneLineConditional:
Enabled: true
Style/NumericPredicate:
Enabled: false

Style/RedundantSortBy:
Enabled: true
Style/Next:
Enabled: false

Style/Sample:
Enabled: true
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%w': '()'

Style/StabbyLambdaParentheses:
Enabled: true
Style/SoleNestedConditional:
Enabled: false

Style/Strip:
Enabled: true
Style/StringHashKeys:
Enabled: false

Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes

# TODO: The styleguide doesn't have an opinion on this yet.
Style/SymbolArray:
Enabled: false

# Disabled, there's a lot of `foo, _ = method_with_two_return_values` with a space in it.
Style/TrailingUnderscoreVariable:
Enabled: false
Loading