-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
rubocop: Only enable Style/Documentation
for @api public
code
#14818
Conversation
Review period will end on 2023-02-28 at 00:00:00 UTC. |
87fc569
to
802aab3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice! Would be also cool if we could somehow detect if private APIs are used in brew style
one day (not in this PR!) so we can warn about them (CC @dduugg for @Bo98 if you have any ideas).
Found the public API paths with git grep -l "@api public".
The only thing I wonder here is if it'd be nice to turn the above, in this PR, into a CI check so stop this list getting out of sync?
Review period ended. |
- Suggested in Homebrew#14709 (comment). - Found the public API paths with `git grep -l "@api public"`.
03145ca
to
746dd44
Compare
- This `Homebrew/utils.rb` file contains one `@api public` method so it's now included in `Style/Documentation`. - This method not having a comment was causing the style specs to fail because this file isn't usually failing RuboCop. - And the test description was confusing so I improved it.
- This is better in the `Library/Homebrew/.rubocop.yml` since it's operating on files that are within that directory.
- This will stop the `Style/Documentation` filepath includes getting out of sync with what we declare as a public API, thus ensuring that everything is documented. - Maybe we could also add a job here to check that _all_ the paths in the RuboCop config still exist, but that's for another time.
- The `Kernel` module, which needed a comment because it has an "@api public" method in it, moved.
746dd44
to
033daca
Compare
Done! |
Co-authored-by: Mike McQuaid <[email protected]>
- The slowest part of the separate workflow was the repo checkout step, so include it in here to avoid the overhead.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?git grep -l "@api public"
.