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 #2968] Added DocumentationMethod Cop. #3296
Conversation
3b8c205
to
cad15e1
Compare
class DocumentationMethod < Cop | ||
include AnnotationComment | ||
|
||
MSG = 'Missing top-level %s documentation method comment.'.freeze |
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.
I don't quite get this message. I'd go for "Missing documentation comment for public method.".
@sooyang ping :-) |
cad15e1
to
412ffc0
Compare
@@ -1,6 +1,7 @@ | |||
# Change log | |||
|
|||
## master (unreleased) | |||
* [#2968](https://github.com/bbatsov/rubocop/issues/2968): Add new `Style/DocumentationMethod` cop. ([@sooyang][]) |
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 should be under New features
.
412ffc0
to
103b6aa
Compare
@bbatsov added |
@@ -10,6 +10,7 @@ | |||
* Add new `Style/TernaryParentheses` cop. ([@drenmi][]) | |||
* [#3136](https://github.com/bbatsov/rubocop/issues/3136): Add config for `UselessAccessModifier` so it can be made aware of ActiveSupport's `concerning` and `class_methods` methods. ([@maxjacobson][]) | |||
* [#3128](https://github.com/bbatsov/rubocop/issues/3128): Add new `Rails/SaveBang` cop. ([@QuinnHarris][]) | |||
* [#2968](https://github.com/bbatsov/rubocop/issues/2968): Add new `Style/DocumentationMethod` cop. ([@sooyang][]) |
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.
You'll have to move this to the master
branch. We just released 0.42.
103b6aa
to
47ad567
Compare
@bbatsov moved |
This cop checks for missing top-level documentation of methods as suggested in issue #2968.
The default is set to false due to pre-existing methods that do not contain the top-level documentation.
Private and Protected methods will not be scanned.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).and description in grammatically correct, complete sentences.