Merge pull request #5312 from reitermarkus/rubocop
Fix RuboCop for Casks.
This commit is contained in:
commit
23da62471b
@ -1,10 +1,4 @@
|
|||||||
AllCops:
|
inherit_from: ./.rubocop_shared.yml
|
||||||
TargetRubyVersion: 2.3
|
|
||||||
Exclude:
|
|
||||||
- '**/vendor/**/*'
|
|
||||||
DisplayCopNames: false
|
|
||||||
|
|
||||||
require: ./Homebrew/rubocops.rb
|
|
||||||
|
|
||||||
# enable all formulae audits
|
# enable all formulae audits
|
||||||
FormulaAudit:
|
FormulaAudit:
|
||||||
@ -14,10 +8,6 @@ FormulaAudit:
|
|||||||
FormulaAuditStrict:
|
FormulaAuditStrict:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# enable all cask audits
|
|
||||||
Cask:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
# disable all formulae strict audits by default
|
# disable all formulae strict audits by default
|
||||||
NewFormulaAudit:
|
NewFormulaAudit:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
inherit_from:
|
inherit_from: ./.rubocop.yml
|
||||||
- ./.rubocop.yml
|
|
||||||
|
|
||||||
NewFormulaAudit:
|
NewFormulaAudit:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|||||||
96
Library/.rubocop_cask.yml
Normal file
96
Library/.rubocop_cask.yml
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
inherit_from: ./.rubocop_shared.yml
|
||||||
|
|
||||||
|
# Cask Cops
|
||||||
|
|
||||||
|
Cask/HomepageMatchesUrl:
|
||||||
|
Description: 'Ensure that the homepage and url match, otherwise add a comment. More info at https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/url.md#when-url-and-homepage-hostnames-differ-add-a-comment'
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Cask/HomepageUrlTrailingSlash:
|
||||||
|
Description: 'Ensure that the homepage url has a slash after the domain name.'
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Cask/NoDslVersion:
|
||||||
|
Description: 'Do not use the deprecated DSL version syntax in your cask header.'
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Cask/StanzaGrouping:
|
||||||
|
Description: 'Ensure that cask stanzas are grouped correctly. More info at https://github.com/Homebrew/homebrew-cask/blob/master/CONTRIBUTING.md#stanza-order'
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Cask/StanzaOrder:
|
||||||
|
Description: 'Ensure that cask stanzas are sorted correctly. More info at https://github.com/Homebrew/homebrew-cask/blob/master/CONTRIBUTING.md#stanza-order'
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# Built-In Cops
|
||||||
|
|
||||||
|
Layout/AlignHash:
|
||||||
|
EnforcedHashRocketStyle: table
|
||||||
|
EnforcedColonStyle: table
|
||||||
|
|
||||||
|
Layout/IndentArray:
|
||||||
|
EnforcedStyle: align_brackets
|
||||||
|
|
||||||
|
Layout/IndentHash:
|
||||||
|
EnforcedStyle: align_braces
|
||||||
|
|
||||||
|
Metrics/BlockLength:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Metrics/LineLength:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Naming/FileName:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Naming/HeredocDelimiterNaming:
|
||||||
|
Blacklist:
|
||||||
|
- END, EOD, EOF
|
||||||
|
|
||||||
|
Performance/StringReplacement:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/BarePercentLiterals:
|
||||||
|
EnforcedStyle: percent_q
|
||||||
|
|
||||||
|
Style/Documentation:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/EmptyElse:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/FrozenStringLiteralComment:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/HashSyntax:
|
||||||
|
EnforcedStyle: ruby19_no_mixed_keys
|
||||||
|
|
||||||
|
Style/IfUnlessModifier:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/PercentLiteralDelimiters:
|
||||||
|
PreferredDelimiters:
|
||||||
|
'%': '{}'
|
||||||
|
'%i': '{}'
|
||||||
|
'%q': '{}'
|
||||||
|
'%Q': '{}'
|
||||||
|
'%r': '{}'
|
||||||
|
'%s': '()'
|
||||||
|
'%w': '[]'
|
||||||
|
'%W': '[]'
|
||||||
|
'%x': '()'
|
||||||
|
|
||||||
|
Style/RegexpLiteral:
|
||||||
|
EnforcedStyle: percent_r
|
||||||
|
|
||||||
|
Style/SymbolArray:
|
||||||
|
EnforcedStyle: brackets
|
||||||
|
|
||||||
|
Style/TrailingCommaInArrayLiteral:
|
||||||
|
EnforcedStyleForMultiline: comma
|
||||||
|
|
||||||
|
Style/TrailingCommaInHashLiteral:
|
||||||
|
EnforcedStyleForMultiline: comma
|
||||||
|
|
||||||
|
Style/WordArray:
|
||||||
|
EnforcedStyle: brackets
|
||||||
7
Library/.rubocop_shared.yml
Normal file
7
Library/.rubocop_shared.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
AllCops:
|
||||||
|
TargetRubyVersion: 2.3
|
||||||
|
Exclude:
|
||||||
|
- '**/vendor/**/*'
|
||||||
|
DisplayCopNames: false
|
||||||
|
|
||||||
|
require: ./Homebrew/rubocops.rb
|
||||||
@ -1,5 +1,4 @@
|
|||||||
inherit_from:
|
inherit_from: ../.rubocop.yml
|
||||||
- ../.rubocop.yml
|
|
||||||
|
|
||||||
AllCops:
|
AllCops:
|
||||||
Include:
|
Include:
|
||||||
|
|||||||
@ -44,7 +44,7 @@ module Cask
|
|||||||
def default_args
|
def default_args
|
||||||
[
|
[
|
||||||
"--force-exclusion",
|
"--force-exclusion",
|
||||||
"--config", "#{HOMEBREW_LIBRARY}/.rubocop.yml",
|
"--config", "#{HOMEBREW_LIBRARY}/.rubocop_cask.yml",
|
||||||
"--format", "simple"
|
"--format", "simple"
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|||||||
@ -5,11 +5,13 @@ describe "brew style" do
|
|||||||
begin
|
begin
|
||||||
FileUtils.ln_s HOMEBREW_LIBRARY_PATH, HOMEBREW_LIBRARY/"Homebrew"
|
FileUtils.ln_s HOMEBREW_LIBRARY_PATH, HOMEBREW_LIBRARY/"Homebrew"
|
||||||
FileUtils.ln_s HOMEBREW_LIBRARY_PATH.parent/".rubocop.yml", HOMEBREW_LIBRARY/".rubocop_audit.yml"
|
FileUtils.ln_s HOMEBREW_LIBRARY_PATH.parent/".rubocop.yml", HOMEBREW_LIBRARY/".rubocop_audit.yml"
|
||||||
|
FileUtils.ln_s HOMEBREW_LIBRARY_PATH.parent/".rubocop_shared.yml", HOMEBREW_LIBRARY/".rubocop_shared.yml"
|
||||||
|
|
||||||
example.run
|
example.run
|
||||||
ensure
|
ensure
|
||||||
FileUtils.rm_f HOMEBREW_LIBRARY/"Homebrew"
|
FileUtils.rm_f HOMEBREW_LIBRARY/"Homebrew"
|
||||||
FileUtils.rm_f HOMEBREW_LIBRARY/".rubocop_audit.yml"
|
FileUtils.rm_f HOMEBREW_LIBRARY/".rubocop_audit.yml"
|
||||||
|
FileUtils.rm_f HOMEBREW_LIBRARY/".rubocop_shared.yml"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user