Skip to content

Commit

Permalink
rubocop: Only enable Style/Documentation for @api public code
Browse files Browse the repository at this point in the history
- Suggested in Homebrew#14709 (comment).
- Found the public API paths with `git grep -l "@api public"`.
  • Loading branch information
issyl0 committed Feb 26, 2023
1 parent 66303bd commit 832bd8a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 28 deletions.
46 changes: 40 additions & 6 deletions Library/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,47 @@ Style/DisableCopsWithinSourceCodeDirective:
- "/**/{Formula,Casks}/*.rb"
- "**/{Formula,Casks}/*.rb"

# Don't enforce documentation in casks or formulae.
# Only enforce documentation for public APIs.
Style/Documentation:
Exclude:
- "Taps/**/*"
- "/**/{Formula,Casks}/*.rb"
- "**/{Formula,Casks}/*.rb"
- "**/*.rbi"
AllowedConstants:
- Homebrew
Include:
- Homebrew/cask/dsl.rb
- Homebrew/cask/dsl/version.rb
- Homebrew/cask/url.rb
- Homebrew/download_strategy.rb
- Homebrew/formula.rb
- Homebrew/formula_assertions.rb
- Homebrew/formula_free_port.rb
- Homebrew/language/go.rb
- Homebrew/language/java.rb
- Homebrew/language/node.rb
- Homebrew/language/perl.rb
- Homebrew/language/python.rb
- Homebrew/livecheck/strategy/apache.rb
- Homebrew/livecheck/strategy/bitbucket.rb
- Homebrew/livecheck/strategy/cpan.rb
- Homebrew/livecheck/strategy/extract_plist.rb
- Homebrew/livecheck/strategy/git.rb
- Homebrew/livecheck/strategy/github_latest.rb
- Homebrew/livecheck/strategy/gnome.rb
- Homebrew/livecheck/strategy/gnu.rb
- Homebrew/livecheck/strategy/hackage.rb
- Homebrew/livecheck/strategy/json.rb
- Homebrew/livecheck/strategy/launchpad.rb
- Homebrew/livecheck/strategy/npm.rb
- Homebrew/livecheck/strategy/page_match.rb
- Homebrew/livecheck/strategy/pypi.rb
- Homebrew/livecheck/strategy/sourceforge.rb
- Homebrew/livecheck/strategy/sparkle.rb
- Homebrew/livecheck/strategy/xorg.rb
- Homebrew/os.rb
- Homebrew/resource.rb
- Homebrew/utils.rb
- Homebrew/utils/inreplace.rb
- Homebrew/utils/shebang.rb
- Homebrew/utils/string_inreplace_extension.rb
- Homebrew/version.rb

Style/DocumentationMethod:
Include:
Expand Down
22 changes: 0 additions & 22 deletions Library/Homebrew/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,6 @@ Naming/PredicateName:
- is_32_bit?
- is_64_bit?

Style/Documentation:
AllowedConstants:
- Homebrew
Exclude:
- "extend/**/*.rb"
- "test/**/*.rb"
- "cask/macos.rb"
- "cli/args.rb"
- "cli/parser.rb"
- "cmd/list.rb"
- "cmd/update-report.rb"
- "dev-cmd/irb.rb"
- "dev-cmd/pr-pull.rb"
- "keg_relocate.rb"
- "os/mac/keg.rb"
- "software_spec.rb"
- "utils.rb"
- "utils/fork.rb"
- "utils/git_repository.rb"
- "utils/popen.rb"
- "utils/shell.rb"

Style/HashAsLastArrayItem:
Exclude:
- "test/utils/spdx_spec.rb"
Expand Down

0 comments on commit 832bd8a

Please sign in to comment.