mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
docs: fix brew style
This commit is contained in:
parent
dbe03743f8
commit
ed0d6b7f61
@ -144,7 +144,7 @@ module Homebrew
|
|||||||
files&.map!(&:expand_path)
|
files&.map!(&:expand_path)
|
||||||
if files.blank? || files == [HOMEBREW_REPOSITORY]
|
if files.blank? || files == [HOMEBREW_REPOSITORY]
|
||||||
files = [HOMEBREW_LIBRARY_PATH]
|
files = [HOMEBREW_LIBRARY_PATH]
|
||||||
elsif files.any? { |f| f.to_s.start_with? HOMEBREW_REPOSITORY/"docs" }
|
elsif files.any? { |f| (f.to_s.start_with? HOMEBREW_REPOSITORY/"docs") || (f.basename == "docs") }
|
||||||
args << "--config" << (HOMEBREW_REPOSITORY/"docs/.rubocop.yml")
|
args << "--config" << (HOMEBREW_REPOSITORY/"docs/.rubocop.yml")
|
||||||
elsif files.none? { |f| f.to_s.start_with? HOMEBREW_LIBRARY_PATH }
|
elsif files.none? { |f| f.to_s.start_with? HOMEBREW_LIBRARY_PATH }
|
||||||
args << "--config" << (HOMEBREW_LIBRARY/".rubocop.yml")
|
args << "--config" << (HOMEBREW_LIBRARY/".rubocop.yml")
|
||||||
|
@ -2,11 +2,12 @@ inherit_from: ../Library/.rubocop.yml
|
|||||||
|
|
||||||
AllCops:
|
AllCops:
|
||||||
Exclude:
|
Exclude:
|
||||||
- Gemfile
|
- Gemfile
|
||||||
- ".mdl*.rb"
|
- ".mdl*.rb"
|
||||||
- Rakefile
|
- Rakefile
|
||||||
- "_site/**/*"
|
- "_site/**/*"
|
||||||
- Manpage.md
|
- Manpage.md
|
||||||
|
- "vendor/**/*"
|
||||||
|
|
||||||
# These are included in docs deliberately to show what
|
# These are included in docs deliberately to show what
|
||||||
# `brew create` does and what the user should replace.
|
# `brew create` does and what the user should replace.
|
||||||
@ -21,7 +22,7 @@ FormulaAudit/Homepage:
|
|||||||
|
|
||||||
Layout/LineLength:
|
Layout/LineLength:
|
||||||
Exclude:
|
Exclude:
|
||||||
- Bottles.md # The bottle block line length is long in its full form.
|
- Bottles.md # The bottle block line length is long in its full form.
|
||||||
|
|
||||||
# Apparently Casks are allowed to have constant definitions in blocks and we document this.
|
# Apparently Casks are allowed to have constant definitions in blocks and we document this.
|
||||||
Lint/ConstantDefinitionInBlock:
|
Lint/ConstantDefinitionInBlock:
|
||||||
@ -30,3 +31,7 @@ Lint/ConstantDefinitionInBlock:
|
|||||||
# A fake regexp is deliberately documented for `inreplace` in the Formula Cookbook.
|
# A fake regexp is deliberately documented for `inreplace` in the Formula Cookbook.
|
||||||
Style/RedundantRegexpArgument:
|
Style/RedundantRegexpArgument:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
# Want to be able to display partial formulae in the docs.
|
||||||
|
Style/TopLevelMethodDefinition:
|
||||||
|
Enabled: false
|
||||||
|
@ -188,7 +188,7 @@ A `strategy` block for `Git` is a bit different, as the block receives an array
|
|||||||
livecheck do
|
livecheck do
|
||||||
url :stable
|
url :stable
|
||||||
strategy :git do |tags|
|
strategy :git do |tags|
|
||||||
tags.map { |tag| tag[/^(\d{4}-\d{2}-\d{2})$/i, 1]&.gsub(/\D/, "") }.compact
|
tags.filter_map { |tag| tag[/^(\d{4}-\d{2}-\d{2})$/i, 1]&.gsub(/\D/, "") }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
@ -73,9 +73,9 @@ module Homebrew
|
|||||||
Do something. Place a description here.
|
Do something. Place a description here.
|
||||||
EOS
|
EOS
|
||||||
switch "-f", "--force",
|
switch "-f", "--force",
|
||||||
description: "Force doing something in the command."
|
description: "Force doing something in the command."
|
||||||
flag "--file=",
|
flag "--file=",
|
||||||
description: "Specify a file to do something with in the command."
|
description: "Specify a file to do something with in the command."
|
||||||
comma_array "--names",
|
comma_array "--names",
|
||||||
description: "Add a list of names to the command."
|
description: "Add a list of names to the command."
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user