mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
rubocop: Revert PR 15312, unset EnabledByDefault
- This proved sufficiently controversial in the comments of https://github.com/Homebrew/brew/issues/15297. - There are too many cops in this list that _don't_ make sense for us. - For the few that do (with many thanks to Bo for going in depth to figure them out!), we can selectively enable them without using EnabledByDefault` and a whole load of `Enabled: false`.
This commit is contained in:
parent
89dfe4fc5b
commit
a1f855bb1b
@ -14,7 +14,6 @@ inherit_mode:
|
|||||||
AllCops:
|
AllCops:
|
||||||
TargetRubyVersion: 2.6
|
TargetRubyVersion: 2.6
|
||||||
ActiveSupportExtensionsEnabled: true
|
ActiveSupportExtensionsEnabled: true
|
||||||
EnabledByDefault: true
|
|
||||||
NewCops: enable
|
NewCops: enable
|
||||||
Include:
|
Include:
|
||||||
- "**/*.rbi"
|
- "**/*.rbi"
|
||||||
@ -26,23 +25,30 @@ 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/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:
|
||||||
@ -59,34 +65,6 @@ 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
|
||||||
@ -153,12 +131,6 @@ 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"
|
||||||
@ -219,41 +191,56 @@ Naming/VariableNumber:
|
|||||||
Performance/Caller:
|
Performance/Caller:
|
||||||
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/MethodObjectAsBlock:
|
Performance/MethodObjectAsBlock:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# TODO: This group of cops comes from `EnabledByDefault: true`. We should maybe enable the ones with < 100 offenses.
|
|
||||||
Performance/ChainArrayAllocation:
|
|
||||||
Enabled: false
|
|
||||||
Performance/IoReadlines:
|
|
||||||
Enabled: false
|
|
||||||
Performance/OpenStruct:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Rails:
|
Rails:
|
||||||
|
# Selectively enable what we want.
|
||||||
|
Enabled: false
|
||||||
# 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:
|
||||||
# TODO: This group of cops comes from `EnabledByDefault: true`. We should maybe enable the ones with < 100 offenses.
|
Enabled: true
|
||||||
Rails/ArelStar:
|
Rails/DurationArithmetic:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
Rails/Date:
|
Rails/ExpandedDateRange:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
Rails/RakeEnvironment:
|
Rails/Inquiry:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
Rails/Pluck:
|
Rails/NegateInclude:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
Rails/SaveBang:
|
Rails/PluralizationGrammar:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
Rails/SkipsModelValidations:
|
Rails/Presence:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
Rails/TimeZone:
|
Rails/Present:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
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:
|
||||||
@ -267,16 +254,6 @@ 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
|
||||||
@ -303,21 +280,12 @@ Sorbet/ConstantsFromStrings:
|
|||||||
Sorbet/FalseSigil:
|
Sorbet/FalseSigil:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# TODO: These cops come from `EnabledByDefault: true`. We should maybe enable the ones with < 100 offenses.
|
# T::Sig is monkey-patched into Module
|
||||||
Sorbet/EnforceSignatures:
|
Sorbet/RedundantExtendTSig:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
Sorbet/ForbidTUnsafe:
|
|
||||||
Enabled: false
|
|
||||||
Sorbet/ForbidTUntyped:
|
|
||||||
Enabled: false
|
|
||||||
Sorbet/HasSigil:
|
|
||||||
Enabled: false
|
|
||||||
Sorbet/IgnoreSigil:
|
|
||||||
Enabled: false
|
|
||||||
Sorbet/StrongSigil:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Sorbet/StrictSigil:
|
Sorbet/StrictSigil:
|
||||||
|
Enabled: true
|
||||||
inherit_mode:
|
inherit_mode:
|
||||||
override:
|
override:
|
||||||
- Include
|
- Include
|
||||||
@ -325,6 +293,7 @@ Sorbet/StrictSigil:
|
|||||||
- "**/*.rbi"
|
- "**/*.rbi"
|
||||||
|
|
||||||
Sorbet/TrueSigil:
|
Sorbet/TrueSigil:
|
||||||
|
Enabled: true
|
||||||
Exclude:
|
Exclude:
|
||||||
- "Taps/**/*"
|
- "Taps/**/*"
|
||||||
- "/**/{Formula,Casks}/**/*.rb"
|
- "/**/{Formula,Casks}/**/*.rb"
|
||||||
@ -335,6 +304,10 @@ 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
|
||||||
@ -343,56 +316,13 @@ Style/BlockDelimiters:
|
|||||||
BracesRequiredMethods:
|
BracesRequiredMethods:
|
||||||
- "sig"
|
- "sig"
|
||||||
|
|
||||||
# TODO: This group of cops comes from `EnabledByDefault: true`. We should maybe enable the ones with < 100 offenses.
|
# Use consistent style for better readability.
|
||||||
Style/ArrayCoercion:
|
Style/CollectionMethods:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
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"
|
||||||
@ -440,6 +370,7 @@ 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`
|
||||||
:==: :!=
|
:==: :!=
|
||||||
@ -472,6 +403,10 @@ 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:
|
||||||
@ -492,6 +427,10 @@ 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:
|
||||||
@ -511,6 +450,7 @@ 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