Merge pull request #8589 from claui/fix-audit-for-files

Fix `brew audit Formula/formula.rb`
This commit is contained in:
Markus Reiter 2020-11-16 21:29:49 +01:00 committed by GitHub
commit 218d3e2fcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 11 deletions

View File

@ -108,7 +108,9 @@ Style/HashTransformValues:
# Allow for license expressions # Allow for license expressions
Style/HashAsLastArrayItem: Style/HashAsLastArrayItem:
Exclude: Exclude:
- 'Taps/*/*/{Formula/,}*.rb' - 'Taps/*/*/*.rb'
- '/**/Formula/*.rb'
- '**/Formula/*.rb'
# Enabled now LineLength is lowish. # Enabled now LineLength is lowish.
Style/IfUnlessModifier: Style/IfUnlessModifier:
@ -165,7 +167,9 @@ Performance/Caller:
Style/DisableCopsWithinSourceCodeDirective: Style/DisableCopsWithinSourceCodeDirective:
Enabled: true Enabled: true
Include: Include:
- 'Taps/*/*/{Formula/,Casks/,}*.rb' - 'Taps/*/*/*.rb'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
# make our hashes consistent # make our hashes consistent
Layout/HashAlignment: Layout/HashAlignment:
@ -175,7 +179,9 @@ Layout/HashAlignment:
# `system` is a special case and aligns on second argument, so allow this for formulae. # `system` is a special case and aligns on second argument, so allow this for formulae.
Layout/ArgumentAlignment: Layout/ArgumentAlignment:
Exclude: Exclude:
- 'Taps/*/*/{Formula/,}*.rb' - 'Taps/*/*/*.rb'
- '/**/Formula/*.rb'
- '**/Formula/*.rb'
# this is a bit less "floaty" # this is a bit less "floaty"
Layout/CaseIndentation: Layout/CaseIndentation:
@ -199,7 +205,9 @@ Lint/AmbiguousBlockAssociation:
Lint/DuplicateBranch: Lint/DuplicateBranch:
Exclude: Exclude:
- 'Taps/*/*/{Formula,Casks,}/*.rb' - 'Taps/*/*/*.rb'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
# needed for lazy_object magic # needed for lazy_object magic
Naming/MemoizedInstanceVariableName: Naming/MemoizedInstanceVariableName:
@ -210,7 +218,9 @@ Naming/MemoizedInstanceVariableName:
# TODO: fix these as `ruby -w` complains about them. # TODO: fix these as `ruby -w` complains about them.
Lint/AmbiguousRegexpLiteral: Lint/AmbiguousRegexpLiteral:
Exclude: Exclude:
- 'Taps/*/*/{Formula/,}*.rb' - 'Taps/*/*/*.rb'
- '/**/Formula/*.rb'
- '**/Formula/*.rb'
# useful for metaprogramming in RSpec # useful for metaprogramming in RSpec
Lint/ConstantDefinitionInBlock: Lint/ConstantDefinitionInBlock:
@ -220,30 +230,46 @@ Lint/ConstantDefinitionInBlock:
# so many of these in formulae and can't be autocorrected # so many of these in formulae and can't be autocorrected
Lint/ParenthesesAsGroupedExpression: Lint/ParenthesesAsGroupedExpression:
Exclude: Exclude:
- 'Taps/*/*/{Formula/,}*.rb' - 'Taps/*/*/*.rb'
- '/**/Formula/*.rb'
- '**/Formula/*.rb'
# Most metrics don't make sense to apply for casks/formulae/taps. # Most metrics don't make sense to apply for casks/formulae/taps.
Metrics/AbcSize: Metrics/AbcSize:
Exclude: Exclude:
- 'Taps/**/*' - 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
Metrics/BlockLength: Metrics/BlockLength:
Exclude: Exclude:
- 'Taps/**/*' - 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
Metrics/ClassLength: Metrics/ClassLength:
Exclude: Exclude:
- 'Taps/**/*' - 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
Metrics/CyclomaticComplexity: Metrics/CyclomaticComplexity:
Exclude: Exclude:
- 'Taps/**/*' - 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
Metrics/MethodLength: Metrics/MethodLength:
Exclude: Exclude:
- 'Taps/**/*' - 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
Metrics/ModuleLength: Metrics/ModuleLength:
Exclude: Exclude:
- 'Taps/**/*' - 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
Metrics/PerceivedComplexity: Metrics/PerceivedComplexity:
Exclude: Exclude:
- 'Taps/**/*' - 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
# allow those that are standard # allow those that are standard
# TODO: try to remove some of these # TODO: try to remove some of these
@ -284,7 +310,9 @@ Layout/LineLength:
Sorbet/FalseSigil: Sorbet/FalseSigil:
Exclude: Exclude:
- 'Taps/**/*.rb' - 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
- 'Homebrew/test/**/Casks/**/*.rb' - 'Homebrew/test/**/Casks/**/*.rb'
Sorbet/StrictSigil: Sorbet/StrictSigil:
@ -320,6 +348,8 @@ Style/ClassVars:
Style/Documentation: Style/Documentation:
Exclude: Exclude:
- 'Taps/**/*' - 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
- '**/*.rbi' - '**/*.rbi'
Style/DocumentationMethod: Style/DocumentationMethod:
@ -330,7 +360,9 @@ Style/DocumentationMethod:
Style/FrozenStringLiteralComment: Style/FrozenStringLiteralComment:
EnforcedStyle: always EnforcedStyle: always
Exclude: Exclude:
- 'Taps/*/*/{Formula,Casks,}/*.rb' - 'Taps/*/*/*.rb'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
- 'Homebrew/test/**/Casks/**/*.rb' - 'Homebrew/test/**/Casks/**/*.rb'
- '**/*.rbi' - '**/*.rbi'
@ -342,7 +374,9 @@ Style/GlobalVars:
# potential for errors in formulae too high with this # potential for errors in formulae too high with this
Style/GuardClause: Style/GuardClause:
Exclude: Exclude:
- 'Taps/*/*/{Formula/,Casks/,}*.rb' - 'Taps/*/*/*.rb'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
# avoid hash rockets where possible # avoid hash rockets where possible
Style/HashSyntax: Style/HashSyntax:
@ -351,7 +385,9 @@ Style/HashSyntax:
# so many of these in formulae and can't be autocorrected # so many of these in formulae and can't be autocorrected
Style/StringConcatenation: Style/StringConcatenation:
Exclude: Exclude:
- 'Taps/*/*/{Formula/,Casks/,}*.rb' - 'Taps/*/*/*.rb'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
# ruby style guide favorite # ruby style guide favorite
Style/StringLiterals: Style/StringLiterals:

View File

@ -9,6 +9,6 @@ cask "with-conditional-caveats" do
# a do block may print and use a DSL # a do block may print and use a DSL
caveats do caveats do
puts "This caveat is conditional" if false # rubocop:disable Lint/LiteralAsCondition puts "This caveat is conditional" unless String("Caffeine") == "Caffeine"
end end
end end