Skip to content

Commit

Permalink
Merge pull request #8589 from claui/fix-audit-for-files
Browse files Browse the repository at this point in the history
Fix `brew audit Formula/formula.rb`
  • Loading branch information
reitermarkus committed Nov 16, 2020
2 parents 07b3aa6 + 3b74045 commit 218d3e2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 11 deletions.
56 changes: 46 additions & 10 deletions Library/.rubocop.yml
Expand Up @@ -108,7 +108,9 @@ Style/HashTransformValues:
# Allow for license expressions
Style/HashAsLastArrayItem:
Exclude:
- 'Taps/*/*/{Formula/,}*.rb'
- 'Taps/*/*/*.rb'
- '/**/Formula/*.rb'
- '**/Formula/*.rb'

# Enabled now LineLength is lowish.
Style/IfUnlessModifier:
Expand Down Expand Up @@ -165,7 +167,9 @@ Performance/Caller:
Style/DisableCopsWithinSourceCodeDirective:
Enabled: true
Include:
- 'Taps/*/*/{Formula/,Casks/,}*.rb'
- 'Taps/*/*/*.rb'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'

# make our hashes consistent
Layout/HashAlignment:
Expand All @@ -175,7 +179,9 @@ Layout/HashAlignment:
# `system` is a special case and aligns on second argument, so allow this for formulae.
Layout/ArgumentAlignment:
Exclude:
- 'Taps/*/*/{Formula/,}*.rb'
- 'Taps/*/*/*.rb'
- '/**/Formula/*.rb'
- '**/Formula/*.rb'

# this is a bit less "floaty"
Layout/CaseIndentation:
Expand All @@ -199,7 +205,9 @@ Lint/AmbiguousBlockAssociation:

Lint/DuplicateBranch:
Exclude:
- 'Taps/*/*/{Formula,Casks,}/*.rb'
- 'Taps/*/*/*.rb'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'

# needed for lazy_object magic
Naming/MemoizedInstanceVariableName:
Expand All @@ -210,7 +218,9 @@ Naming/MemoizedInstanceVariableName:
# TODO: fix these as `ruby -w` complains about them.
Lint/AmbiguousRegexpLiteral:
Exclude:
- 'Taps/*/*/{Formula/,}*.rb'
- 'Taps/*/*/*.rb'
- '/**/Formula/*.rb'
- '**/Formula/*.rb'

# useful for metaprogramming in RSpec
Lint/ConstantDefinitionInBlock:
Expand All @@ -220,30 +230,46 @@ Lint/ConstantDefinitionInBlock:
# so many of these in formulae and can't be autocorrected
Lint/ParenthesesAsGroupedExpression:
Exclude:
- 'Taps/*/*/{Formula/,}*.rb'
- 'Taps/*/*/*.rb'
- '/**/Formula/*.rb'
- '**/Formula/*.rb'

# Most metrics don't make sense to apply for casks/formulae/taps.
Metrics/AbcSize:
Exclude:
- 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
Metrics/BlockLength:
Exclude:
- 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
Metrics/ClassLength:
Exclude:
- 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
Metrics/CyclomaticComplexity:
Exclude:
- 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
Metrics/MethodLength:
Exclude:
- 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
Metrics/ModuleLength:
Exclude:
- 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
Metrics/PerceivedComplexity:
Exclude:
- 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'

# allow those that are standard
# TODO: try to remove some of these
Expand Down Expand Up @@ -284,7 +310,9 @@ Layout/LineLength:

Sorbet/FalseSigil:
Exclude:
- 'Taps/**/*.rb'
- 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
- 'Homebrew/test/**/Casks/**/*.rb'

Sorbet/StrictSigil:
Expand Down Expand Up @@ -320,6 +348,8 @@ Style/ClassVars:
Style/Documentation:
Exclude:
- 'Taps/**/*'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
- '**/*.rbi'

Style/DocumentationMethod:
Expand All @@ -330,7 +360,9 @@ Style/DocumentationMethod:
Style/FrozenStringLiteralComment:
EnforcedStyle: always
Exclude:
- 'Taps/*/*/{Formula,Casks,}/*.rb'
- 'Taps/*/*/*.rb'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'
- 'Homebrew/test/**/Casks/**/*.rb'
- '**/*.rbi'

Expand All @@ -342,7 +374,9 @@ Style/GlobalVars:
# potential for errors in formulae too high with this
Style/GuardClause:
Exclude:
- 'Taps/*/*/{Formula/,Casks/,}*.rb'
- 'Taps/*/*/*.rb'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'

# avoid hash rockets where possible
Style/HashSyntax:
Expand All @@ -351,7 +385,9 @@ Style/HashSyntax:
# so many of these in formulae and can't be autocorrected
Style/StringConcatenation:
Exclude:
- 'Taps/*/*/{Formula/,Casks/,}*.rb'
- 'Taps/*/*/*.rb'
- '/**/{Formula,Casks}/*.rb'
- '**/{Formula,Casks}/*.rb'

# ruby style guide favorite
Style/StringLiterals:
Expand Down
Expand Up @@ -9,6 +9,6 @@

# a do block may print and use a DSL
caveats do
puts "This caveat is conditional" if false # rubocop:disable Lint/LiteralAsCondition
puts "This caveat is conditional" unless String("Caffeine") == "Caffeine"
end
end

0 comments on commit 218d3e2

Please sign in to comment.