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 #2968] Added DocumentationMethod Cop. #3296

Merged
merged 1 commit into from Jul 27, 2016

Conversation

sooyang
Copy link
Contributor

@sooyang sooyang commented Jul 7, 2016

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:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Used the same coding conventions as the rest of the project.
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • All tests are passing.
  • The new code doesn't generate RuboCop offenses.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.

@sooyang sooyang force-pushed the feature/documentation_method branch from 3b8c205 to cad15e1 Compare July 7, 2016 10:54
class DocumentationMethod < Cop
include AnnotationComment

MSG = 'Missing top-level %s documentation method comment.'.freeze
Copy link
Collaborator

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.".

@bbatsov
Copy link
Collaborator

bbatsov commented Jul 15, 2016

@sooyang ping :-)

@sooyang
Copy link
Contributor Author

sooyang commented Jul 17, 2016

@bbatsov @jonas054
noted :)

@sooyang sooyang force-pushed the feature/documentation_method branch from cad15e1 to 412ffc0 Compare July 24, 2016 07:19
@sooyang
Copy link
Contributor Author

sooyang commented Jul 24, 2016

@bbatsov @jonas054
updated :)

@@ -1,6 +1,7 @@
# Change log

## master (unreleased)
* [#2968](https://github.com/bbatsov/rubocop/issues/2968): Add new `Style/DocumentationMethod` cop. ([@sooyang][])
Copy link
Collaborator

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.

@sooyang sooyang force-pushed the feature/documentation_method branch from 412ffc0 to 103b6aa Compare July 25, 2016 15:30
@sooyang
Copy link
Contributor Author

sooyang commented Jul 26, 2016

@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][])
Copy link
Collaborator

@bbatsov bbatsov Jul 26, 2016

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.

@sooyang sooyang force-pushed the feature/documentation_method branch from 103b6aa to 47ad567 Compare July 27, 2016 12:43
@sooyang
Copy link
Contributor Author

sooyang commented Jul 27, 2016

@bbatsov moved

@bbatsov bbatsov merged commit 723aa38 into rubocop:master Jul 27, 2016
Neodelf pushed a commit to Neodelf/rubocop that referenced this pull request Oct 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants