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)
|
||||
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")
|
||||
|
@ -7,6 +7,7 @@ AllCops:
|
||||
- Rakefile
|
||||
- "_site/**/*"
|
||||
- Manpage.md
|
||||
- "vendor/**/*"
|
||||
|
||||
# These are included in docs deliberately to show what
|
||||
# `brew create` does and what the user should replace.
|
||||
@ -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
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user