mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Fix/reenable brew style docs
- start running this check again - check the `docs` basename correctly - use a different name (to a symlink) for the docs rubocop configuration so that path relativity is done correctly: https://docs.rubocop.org/rubocop/configuration.html#path-relativity - add more wildcards to fix docs rubocop exclusions
This commit is contained in:
parent
df2387fd56
commit
a707c708c1
5
.github/workflows/docs.yml
vendored
5
.github/workflows/docs.yml
vendored
@ -60,9 +60,8 @@ jobs:
|
|||||||
working-directory: docs
|
working-directory: docs
|
||||||
run: bundle exec rake lint
|
run: bundle exec rake lint
|
||||||
|
|
||||||
# TODO: reenable when possible.
|
- name: Check code blocks conform to our Ruby style guide
|
||||||
# - name: Check code blocks conform to our Ruby style guide
|
run: brew style docs
|
||||||
# run: brew style docs
|
|
||||||
|
|
||||||
- name: Generate formulae.brew.sh API samples
|
- name: Generate formulae.brew.sh API samples
|
||||||
if: github.repository == 'Homebrew/formulae.brew.sh'
|
if: github.repository == 'Homebrew/formulae.brew.sh'
|
||||||
|
@ -151,8 +151,8 @@ 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") || (f.basename == "docs") }
|
elsif files.any? { |f| f.to_s.start_with?(HOMEBREW_REPOSITORY/"docs") || (f.basename.to_s == "docs") }
|
||||||
args << "--config" << (HOMEBREW_REPOSITORY/"docs/.rubocop.yml")
|
args << "--config" << (HOMEBREW_REPOSITORY/"docs/docs_rubocop_style.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")
|
||||||
end
|
end
|
||||||
|
@ -2,9 +2,9 @@ inherit_from: ../Library/.rubocop.yml
|
|||||||
|
|
||||||
AllCops:
|
AllCops:
|
||||||
Exclude:
|
Exclude:
|
||||||
- "_site/**/*"
|
- "**/_site/**/*"
|
||||||
- Manpage.md
|
- "**/Manpage.md"
|
||||||
- "vendor/**/*"
|
- "**/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.
|
||||||
@ -19,7 +19,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:
|
||||||
|
1
docs/docs_rubocop_style.yml
Symbolic link
1
docs/docs_rubocop_style.yml
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
.rubocop.yml
|
Loading…
x
Reference in New Issue
Block a user