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

Projects
None yet
3 participants
@sooyang
Contributor

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.
Show outdated Hide outdated config/enabled.yml Outdated
require 'spec_helper'
describe RuboCop::Cop::Style::DocumentationMethod do

This comment has been minimized.

@jonas054

jonas054 Jul 11, 2016

Collaborator

You need more examples. Methods in modules, methods on the top level (outside a class), singleton methods, empty methods, different ways of declaring a method private (private def method and private :method), combinations of public and private methods.

@jonas054

jonas054 Jul 11, 2016

Collaborator

You need more examples. Methods in modules, methods on the top level (outside a class), singleton methods, empty methods, different ways of declaring a method private (private def method and private :method), combinations of public and private methods.

Show outdated Hide outdated CHANGELOG.md Outdated
@bbatsov

This comment has been minimized.

Show comment
Hide comment
@bbatsov

bbatsov Jul 15, 2016

Collaborator

@sooyang ping :-)

Collaborator

bbatsov commented Jul 15, 2016

@sooyang ping :-)

@sooyang

This comment has been minimized.

Show comment
Hide comment
@sooyang

sooyang Jul 17, 2016

Contributor

@bbatsov @jonas054
noted :)

Contributor

sooyang commented Jul 17, 2016

@bbatsov @jonas054
noted :)

@sooyang

This comment has been minimized.

Show comment
Hide comment
@sooyang

sooyang Jul 24, 2016

Contributor

@bbatsov @jonas054
updated :)

Contributor

sooyang commented Jul 24, 2016

@bbatsov @jonas054
updated :)

Show outdated Hide outdated CHANGELOG.md Outdated
module RuboCop
module Cop
module Style
# This cop checks for missing documentation comment for public method.

This comment has been minimized.

@bbatsov

bbatsov Jul 24, 2016

Collaborator

Add some examples here of code that would be flagged by the cop. You can see other cops for references - e.g. https://github.com/Drenmi/rubocop/blob/635403972a3b768d9d709f04eed52090d7738d63/lib/rubocop/cop/style/numeric_predicate.rb

@bbatsov

bbatsov Jul 24, 2016

Collaborator

Add some examples here of code that would be flagged by the cop. You can see other cops for references - e.g. https://github.com/Drenmi/rubocop/blob/635403972a3b768d9d709f04eed52090d7738d63/lib/rubocop/cop/style/numeric_predicate.rb

Show outdated Hide outdated config/disabled.yml Outdated
@sooyang

This comment has been minimized.

Show comment
Hide comment
@sooyang

sooyang Jul 26, 2016

Contributor

@bbatsov added

Contributor

sooyang commented Jul 26, 2016

@bbatsov added

Show outdated Hide outdated CHANGELOG.md Outdated
@sooyang

This comment has been minimized.

Show comment
Hide comment
@sooyang

sooyang Jul 27, 2016

Contributor

@bbatsov moved

Contributor

sooyang commented Jul 27, 2016

@bbatsov moved

@bbatsov bbatsov merged commit 723aa38 into rubocop-hq:master Jul 27, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

Neodelf added 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