mirror of
https://github.com/Homebrew/brew.git
synced 2024-11-25 16:33:34 +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)
|
||||
if files.blank? || files == [HOMEBREW_REPOSITORY]
|
||||
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")
|
||||
elsif files.none? { |f| f.to_s.start_with? HOMEBREW_LIBRARY_PATH }
|
||||
args << "--config" << (HOMEBREW_LIBRARY/".rubocop.yml")
|
||||
|
@ -2,11 +2,12 @@ inherit_from: ../Library/.rubocop.yml
|
||||
|
||||
AllCops:
|
||||
Exclude:
|
||||
- Gemfile
|
||||
- ".mdl*.rb"
|
||||
- Rakefile
|
||||
- "_site/**/*"
|
||||
- Manpage.md
|
||||
- Gemfile
|
||||
- ".mdl*.rb"
|
||||
- Rakefile
|
||||
- "_site/**/*"
|
||||
- Manpage.md
|
||||
- "vendor/**/*"
|
||||
|
||||
# These are included in docs deliberately to show what
|
||||
# `brew create` does and what the user should replace.
|
||||
@ -21,7 +22,7 @@ FormulaAudit/Homepage:
|
||||
|
||||
Layout/LineLength:
|
||||
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.
|
||||
Lint/ConstantDefinitionInBlock:
|
||||
@ -30,3 +31,7 @@ Lint/ConstantDefinitionInBlock:
|
||||
# A fake regexp is deliberately documented for `inreplace` in the Formula Cookbook.
|
||||
Style/RedundantRegexpArgument:
|
||||
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
|
||||
url :stable
|
||||
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
|
||||
```
|
||||
|
@ -73,9 +73,9 @@ module Homebrew
|
||||
Do something. Place a description here.
|
||||
EOS
|
||||
switch "-f", "--force",
|
||||
description: "Force doing something in the command."
|
||||
description: "Force doing something in the command."
|
||||
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",
|
||||
description: "Add a list of names to the command."
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user