Merge pull request #15312 from issyl0/rubocop-enabled-by-default
rubocop: Set `EnabledByDefault: true`, disabling cops with offenses
This commit is contained in:
commit
4f1830631a
@ -14,6 +14,7 @@ inherit_mode:
|
|||||||
AllCops:
|
AllCops:
|
||||||
TargetRubyVersion: 2.6
|
TargetRubyVersion: 2.6
|
||||||
ActiveSupportExtensionsEnabled: true
|
ActiveSupportExtensionsEnabled: true
|
||||||
|
EnabledByDefault: true
|
||||||
NewCops: enable
|
NewCops: enable
|
||||||
Include:
|
Include:
|
||||||
- "**/*.rbi"
|
- "**/*.rbi"
|
||||||
@ -25,34 +26,26 @@ AllCops:
|
|||||||
- "Homebrew/vendor/**/*"
|
- "Homebrew/vendor/**/*"
|
||||||
- "Taps/*/*/vendor/**/*"
|
- "Taps/*/*/vendor/**/*"
|
||||||
|
|
||||||
|
# TODO: This group of cops comes from `EnabledByDefault: true`. We should maybe enable the ones with < 100 offenses.
|
||||||
|
Bundler/GemComment:
|
||||||
|
Enabled: false
|
||||||
|
Bundler/GemVersion:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
Cask/Desc:
|
Cask/Desc:
|
||||||
Description: "Ensure that the desc stanza conforms to various content and style checks."
|
Description: "Ensure that the desc stanza conforms to various content and style checks."
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Cask/HomepageUrlTrailingSlash:
|
Cask/HomepageUrlTrailingSlash:
|
||||||
Description: "Ensure that the homepage url has a slash after the domain name."
|
Description: "Ensure that the homepage url has a slash after the domain name."
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Cask/NoDslVersion:
|
Cask/NoDslVersion:
|
||||||
Description: "Do not use the deprecated DSL version syntax in your cask header."
|
Description: "Do not use the deprecated DSL version syntax in your cask header."
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Cask/StanzaGrouping:
|
Cask/StanzaGrouping:
|
||||||
Description: "Ensure that cask stanzas are grouped correctly. More info at https://docs.brew.sh/Cask-Cookbook#stanza-order"
|
Description: "Ensure that cask stanzas are grouped correctly. More info at https://docs.brew.sh/Cask-Cookbook#stanza-order"
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Cask/StanzaOrder:
|
Cask/StanzaOrder:
|
||||||
Description: "Ensure that cask stanzas are sorted correctly. More info at https://docs.brew.sh/Cask-Cookbook#stanza-order"
|
Description: "Ensure that cask stanzas are sorted correctly. More info at https://docs.brew.sh/Cask-Cookbook#stanza-order"
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
FormulaAudit:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
FormulaAuditStrict:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Homebrew:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
# only used internally
|
# only used internally
|
||||||
Homebrew/MoveToExtendOS:
|
Homebrew/MoveToExtendOS:
|
||||||
@ -69,6 +62,34 @@ Layout/ArgumentAlignment:
|
|||||||
Layout/CaseIndentation:
|
Layout/CaseIndentation:
|
||||||
EnforcedStyle: end
|
EnforcedStyle: end
|
||||||
|
|
||||||
|
# TODO: This group of cops comes from `EnabledByDefault: true`. We should maybe enable the ones with < 100 offenses.
|
||||||
|
Layout/ClassStructure:
|
||||||
|
Enabled: false
|
||||||
|
Layout/EmptyLineAfterMultilineCondition:
|
||||||
|
Enabled: false
|
||||||
|
Layout/FirstArrayElementLineBreak:
|
||||||
|
Enabled: false
|
||||||
|
Layout/FirstHashElementLineBreak:
|
||||||
|
Enabled: false
|
||||||
|
Layout/FirstMethodArgumentLineBreak:
|
||||||
|
Enabled: false
|
||||||
|
Layout/FirstMethodParameterLineBreak:
|
||||||
|
Enabled: false
|
||||||
|
Layout/MultilineArrayLineBreaks:
|
||||||
|
Enabled: false
|
||||||
|
Layout/MultilineAssignmentLayout:
|
||||||
|
Enabled: false
|
||||||
|
Layout/MultilineHashKeyLineBreaks:
|
||||||
|
Enabled: false
|
||||||
|
Layout/MultilineMethodArgumentLineBreaks:
|
||||||
|
Enabled: false
|
||||||
|
Layout/MultilineMethodParameterLineBreaks:
|
||||||
|
Enabled: false
|
||||||
|
Layout/RedundantLineBreak:
|
||||||
|
Enabled: false
|
||||||
|
Layout/SingleLineBlockChain:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
# significantly less indentation involved; more consistent
|
# significantly less indentation involved; more consistent
|
||||||
Layout/FirstArrayElementIndentation:
|
Layout/FirstArrayElementIndentation:
|
||||||
EnforcedStyle: consistent
|
EnforcedStyle: consistent
|
||||||
@ -135,6 +156,12 @@ Layout/SpaceBeforeBrackets:
|
|||||||
Lint/AmbiguousBlockAssociation:
|
Lint/AmbiguousBlockAssociation:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
# TODO: This group of cops comes from `EnabledByDefault: true`. We should maybe enable the ones with < 100 offenses.
|
||||||
|
Lint/ConstantResolution:
|
||||||
|
Enabled: false
|
||||||
|
Lint/NumberConversion:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
Lint/DuplicateBranch:
|
Lint/DuplicateBranch:
|
||||||
Exclude:
|
Exclude:
|
||||||
- "Taps/*/*/*.rb"
|
- "Taps/*/*/*.rb"
|
||||||
@ -191,10 +218,6 @@ Naming/MethodParameterName:
|
|||||||
Naming/VariableNumber:
|
Naming/VariableNumber:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# Does not hinder readability, so might as well enable it.
|
|
||||||
Performance/CaseWhenSplat:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
# Makes code less readable for minor performance increases.
|
# Makes code less readable for minor performance increases.
|
||||||
Performance/Caller:
|
Performance/Caller:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
@ -203,48 +226,37 @@ Performance/Caller:
|
|||||||
Performance/MethodObjectAsBlock:
|
Performance/MethodObjectAsBlock:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Rails:
|
# TODO: This group of cops comes from `EnabledByDefault: true`. We should maybe enable the ones with < 100 offenses.
|
||||||
# Selectively enable what we want.
|
Performance/ChainArrayAllocation:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
Performance/IoReadlines:
|
||||||
|
Enabled: false
|
||||||
|
Performance/OpenStruct:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Rails:
|
||||||
# Do not use ActiveSupport in RuboCops.
|
# Do not use ActiveSupport in RuboCops.
|
||||||
Exclude:
|
Exclude:
|
||||||
- "Homebrew/rubocops/**/*"
|
- "Homebrew/rubocops/**/*"
|
||||||
|
|
||||||
# These relate to ActiveSupport and not other parts of Rails.
|
|
||||||
Rails/ActiveSupportAliases:
|
|
||||||
Enabled: true
|
|
||||||
Rails/Blank:
|
|
||||||
Enabled: true
|
|
||||||
Rails/CompactBlank:
|
|
||||||
Enabled: true
|
|
||||||
Rails/Delegate:
|
Rails/Delegate:
|
||||||
Enabled: false # TODO
|
Enabled: false # TODO
|
||||||
Rails/DelegateAllowBlank:
|
|
||||||
Enabled: true
|
# TODO: This group of cops comes from `EnabledByDefault: true`. We should maybe enable the ones with < 100 offenses.
|
||||||
Rails/DurationArithmetic:
|
Rails/ArelStar:
|
||||||
Enabled: true
|
Enabled: false
|
||||||
Rails/ExpandedDateRange:
|
Rails/Date:
|
||||||
Enabled: true
|
Enabled: false
|
||||||
Rails/Inquiry:
|
Rails/RakeEnvironment:
|
||||||
Enabled: true
|
Enabled: false
|
||||||
Rails/NegateInclude:
|
Rails/Pluck:
|
||||||
Enabled: true
|
Enabled: false
|
||||||
Rails/PluralizationGrammar:
|
Rails/SaveBang:
|
||||||
Enabled: true
|
Enabled: false
|
||||||
Rails/Presence:
|
Rails/SkipsModelValidations:
|
||||||
Enabled: true
|
Enabled: false
|
||||||
Rails/Present:
|
Rails/TimeZone:
|
||||||
Enabled: true
|
Enabled: false
|
||||||
Rails/RelativeDateConstant:
|
|
||||||
Enabled: true
|
|
||||||
Rails/SafeNavigation:
|
|
||||||
Enabled: true
|
|
||||||
Rails/SafeNavigationWithBlank:
|
|
||||||
Enabled: true
|
|
||||||
Rails/StripHeredoc:
|
|
||||||
Enabled: true
|
|
||||||
Rails/ToFormattedS:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
# Intentionally disabled as it doesn't fit with our code style.
|
# Intentionally disabled as it doesn't fit with our code style.
|
||||||
RSpec/AnyInstance:
|
RSpec/AnyInstance:
|
||||||
@ -258,6 +270,16 @@ RSpec/StubbedMock:
|
|||||||
RSpec/SubjectStub:
|
RSpec/SubjectStub:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
# TODO: These cops come from `EnabledByDefault: true`. We should maybe enable the ones with < 100 offenses.
|
||||||
|
RSpec/AlignLeftLetBrace:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/AlignRightLetBrace:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/MessageExpectation:
|
||||||
|
Enabled: false
|
||||||
|
RSpec/Pending:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
# We use `allow(:foo).to receive(:bar)` everywhere.
|
# We use `allow(:foo).to receive(:bar)` everywhere.
|
||||||
RSpec/MessageSpies:
|
RSpec/MessageSpies:
|
||||||
EnforcedStyle: receive
|
EnforcedStyle: receive
|
||||||
@ -284,20 +306,28 @@ Sorbet/ConstantsFromStrings:
|
|||||||
Sorbet/FalseSigil:
|
Sorbet/FalseSigil:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# T::Sig is monkey-patched into Module
|
# TODO: These cops come from `EnabledByDefault: true`. We should maybe enable the ones with < 100 offenses.
|
||||||
Sorbet/RedundantExtendTSig:
|
Sorbet/EnforceSignatures:
|
||||||
Enabled: true
|
Enabled: false
|
||||||
|
Sorbet/ForbidTUnsafe:
|
||||||
|
Enabled: false
|
||||||
|
Sorbet/ForbidTUntyped:
|
||||||
|
Enabled: false
|
||||||
|
Sorbet/HasSigil:
|
||||||
|
Enabled: false
|
||||||
|
Sorbet/IgnoreSigil:
|
||||||
|
Enabled: false
|
||||||
|
Sorbet/StrongSigil:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
Sorbet/StrictSigil:
|
Sorbet/StrictSigil:
|
||||||
inherit_mode:
|
inherit_mode:
|
||||||
override:
|
override:
|
||||||
- Include
|
- Include
|
||||||
Enabled: true
|
|
||||||
Include:
|
Include:
|
||||||
- "**/*.rbi"
|
- "**/*.rbi"
|
||||||
|
|
||||||
Sorbet/TrueSigil:
|
Sorbet/TrueSigil:
|
||||||
Enabled: true
|
|
||||||
Exclude:
|
Exclude:
|
||||||
- "Taps/**/*"
|
- "Taps/**/*"
|
||||||
- "/**/{Formula,Casks}/**/*.rb"
|
- "/**/{Formula,Casks}/**/*.rb"
|
||||||
@ -308,10 +338,6 @@ Sorbet/TrueSigil:
|
|||||||
Style/AndOr:
|
Style/AndOr:
|
||||||
EnforcedStyle: always
|
EnforcedStyle: always
|
||||||
|
|
||||||
# Avoid leaking resources.
|
|
||||||
Style/AutoResourceCleanup:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
# This makes these a little more obvious.
|
# This makes these a little more obvious.
|
||||||
Style/BarePercentLiterals:
|
Style/BarePercentLiterals:
|
||||||
EnforcedStyle: percent_q
|
EnforcedStyle: percent_q
|
||||||
@ -320,13 +346,56 @@ Style/BlockDelimiters:
|
|||||||
BracesRequiredMethods:
|
BracesRequiredMethods:
|
||||||
- "sig"
|
- "sig"
|
||||||
|
|
||||||
# Use consistent style for better readability.
|
# TODO: This group of cops comes from `EnabledByDefault: true`. We should maybe enable the ones with < 100 offenses.
|
||||||
Style/CollectionMethods:
|
Style/ArrayCoercion:
|
||||||
Enabled: true
|
Enabled: false
|
||||||
|
Style/AsciiComments:
|
||||||
|
Enabled: false
|
||||||
|
Style/ClassMethodsDefinitions:
|
||||||
|
Enabled: false
|
||||||
|
Style/ConstantVisibility:
|
||||||
|
Enabled: false
|
||||||
|
Style/Copyright:
|
||||||
|
Enabled: false
|
||||||
|
Style/DateTime:
|
||||||
|
Enabled: false
|
||||||
|
Style/DocumentationMethod:
|
||||||
|
Enabled: false
|
||||||
|
Style/ImplicitRuntimeError:
|
||||||
|
Enabled: false
|
||||||
|
Style/InlineComment:
|
||||||
|
Enabled: false
|
||||||
|
Style/IpAddresses:
|
||||||
|
Enabled: false
|
||||||
|
Style/MethodCallWithArgsParentheses:
|
||||||
|
Enabled: false
|
||||||
|
Style/MethodCalledOnDoEndBlock:
|
||||||
|
Enabled: false
|
||||||
|
Style/MissingElse:
|
||||||
|
Enabled: false
|
||||||
|
Style/MultilineMethodSignature:
|
||||||
|
Enabled: false
|
||||||
|
Style/OptionHash:
|
||||||
|
Enabled: false
|
||||||
|
Style/RequireOrder:
|
||||||
|
Enabled: false
|
||||||
|
Style/Send:
|
||||||
|
Enabled: false
|
||||||
|
Style/SingleLineBlockParams:
|
||||||
|
Enabled: false
|
||||||
|
Style/StaticClass:
|
||||||
|
Enabled: false
|
||||||
|
Style/StringHashKeys:
|
||||||
|
Enabled: false
|
||||||
|
Style/TopLevelMethodDefinition:
|
||||||
|
Enabled: false
|
||||||
|
Style/TrailingCommaInBlockArgs:
|
||||||
|
Enabled: false
|
||||||
|
Style/YodaExpression:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
# Don't allow cops to be disabled in casks and formulae.
|
# Don't allow cops to be disabled in casks and formulae.
|
||||||
Style/DisableCopsWithinSourceCodeDirective:
|
Style/DisableCopsWithinSourceCodeDirective:
|
||||||
Enabled: true
|
|
||||||
Include:
|
Include:
|
||||||
- "Taps/*/*/*.rb"
|
- "Taps/*/*/*.rb"
|
||||||
- "/**/{Formula,Casks}/**/*.rb"
|
- "/**/{Formula,Casks}/**/*.rb"
|
||||||
@ -374,7 +443,6 @@ Style/HashAsLastArrayItem:
|
|||||||
- "**/Formula/**/*.rb"
|
- "**/Formula/**/*.rb"
|
||||||
|
|
||||||
Style/InvertibleUnlessCondition:
|
Style/InvertibleUnlessCondition:
|
||||||
Enabled: true
|
|
||||||
InverseMethods:
|
InverseMethods:
|
||||||
# Favor `if a != b` over `unless a == b`
|
# Favor `if a != b` over `unless a == b`
|
||||||
:==: :!=
|
:==: :!=
|
||||||
@ -407,10 +475,6 @@ Style/OpenStructUse:
|
|||||||
Style/RescueStandardError:
|
Style/RescueStandardError:
|
||||||
EnforcedStyle: implicit
|
EnforcedStyle: implicit
|
||||||
|
|
||||||
# Returning `nil` is unnecessary.
|
|
||||||
Style/ReturnNil:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
# We have no use for using `warn` because we
|
# We have no use for using `warn` because we
|
||||||
# are calling Ruby with warnings disabled.
|
# are calling Ruby with warnings disabled.
|
||||||
Style/StderrPuts:
|
Style/StderrPuts:
|
||||||
@ -431,10 +495,6 @@ Style/StringLiterals:
|
|||||||
Style/StringLiteralsInInterpolation:
|
Style/StringLiteralsInInterpolation:
|
||||||
EnforcedStyle: double_quotes
|
EnforcedStyle: double_quotes
|
||||||
|
|
||||||
# Use consistent method names.
|
|
||||||
Style/StringMethods:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
# An array of symbols is more readable than a symbol array
|
# An array of symbols is more readable than a symbol array
|
||||||
# and also allows for easier grepping.
|
# and also allows for easier grepping.
|
||||||
Style/SymbolArray:
|
Style/SymbolArray:
|
||||||
@ -454,7 +514,6 @@ Style/TrailingCommaInHashLiteral:
|
|||||||
|
|
||||||
# `unless ... ||` and `unless ... &&` are hard to mentally parse
|
# `unless ... ||` and `unless ... &&` are hard to mentally parse
|
||||||
Style/UnlessLogicalOperators:
|
Style/UnlessLogicalOperators:
|
||||||
Enabled: true
|
|
||||||
EnforcedStyle: forbid_logical_operators
|
EnforcedStyle: forbid_logical_operators
|
||||||
|
|
||||||
# a bit confusing to non-Rubyists but useful for longer arrays
|
# a bit confusing to non-Rubyists but useful for longer arrays
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user