docs: fix brew style

This commit is contained in:
Mike McQuaid 2024-06-12 19:17:17 +01:00
parent dbe03743f8
commit ed0d6b7f61
No known key found for this signature in database
4 changed files with 15 additions and 10 deletions

View File

@ -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")

View File

@ -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

View File

@ -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
```