Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/reenable brew style docs #17491

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ jobs:
working-directory: docs
run: bundle exec rake lint

# TODO: reenable when possible.
# - name: Check code blocks conform to our Ruby style guide
# run: brew style docs
- name: Check code blocks conform to our Ruby style guide
run: brew style docs

- name: Generate formulae.brew.sh API samples
if: github.repository == 'Homebrew/formulae.brew.sh'
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ def self.run_rubocop(files, output_type,
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") || (f.basename == "docs") }
args << "--config" << (HOMEBREW_REPOSITORY/"docs/.rubocop.yml")
elsif files.any? { |f| f.to_s.start_with?(HOMEBREW_REPOSITORY/"docs") || (f.basename.to_s == "docs") }
args << "--config" << (HOMEBREW_REPOSITORY/"docs/docs_rubocop_style.yml")
elsif files.none? { |f| f.to_s.start_with? HOMEBREW_LIBRARY_PATH }
args << "--config" << (HOMEBREW_LIBRARY/".rubocop.yml")
end
Expand Down
8 changes: 4 additions & 4 deletions docs/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ inherit_from: ../Library/.rubocop.yml

AllCops:
Exclude:
- "_site/**/*"
- Manpage.md
- "vendor/**/*"
- "**/_site/**/*"
- "**/Manpage.md"
- "**/vendor/**/*"

# These are included in docs deliberately to show what
# `brew create` does and what the user should replace.
Expand All @@ -19,7 +19,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:
Expand Down
1 change: 1 addition & 0 deletions docs/docs_rubocop_style.yml