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

check the comments or document before each function? #2968

Closed
ahuang opened this Issue Mar 21, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@ahuang

ahuang commented Mar 21, 2016

Expected behavior

Hi,
i find the rule 'Style/Documentation' can check documentation before class or module
i want to add a rule to check the comment or document before each function.
i do not find this kind of rule?
can rubocop support it ?

RuboCop version

Include the output of rubocop -V:

$ rubocop -V
0.35.1( running on ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux])
@bbatsov

This comment has been minimized.

Show comment
Hide comment
@bbatsov

bbatsov Mar 21, 2016

Collaborator

i do not find this kind of rule?

True, we don't have this.

can rubocop support it ?

Yes, we can certainly implement something like this. Although it should probably check only public methods.

Collaborator

bbatsov commented Mar 21, 2016

i do not find this kind of rule?

True, we don't have this.

can rubocop support it ?

Yes, we can certainly implement something like this. Although it should probably check only public methods.

@ahuang

This comment has been minimized.

Show comment
Hide comment
@ahuang

ahuang commented Mar 22, 2016

thanks! @bbatsov

sooyang added a commit to sooyang/rubocop that referenced this issue Jul 7, 2016

sooyang added a commit to sooyang/rubocop that referenced this issue Jul 7, 2016

@sooyang sooyang referenced this issue Jul 7, 2016

Merged

[Fix #2968] Added DocumentationMethod Cop. #3296

10 of 10 tasks complete

sooyang added a commit to sooyang/rubocop that referenced this issue Jul 7, 2016

sooyang added a commit to sooyang/rubocop that referenced this issue Jul 24, 2016

sooyang added a commit to sooyang/rubocop that referenced this issue Jul 25, 2016

sooyang added a commit to sooyang/rubocop that referenced this issue Jul 27, 2016

@bbatsov bbatsov closed this in 723aa38 Jul 27, 2016

@qnm

This comment has been minimized.

Show comment
Hide comment
@qnm

qnm Jul 28, 2016

This is a great feature, thanks!

Yes, we can certainly implement something like this. Although it should probably check only public methods.

I generally agree - however depending on local coding standards, this should be configurable.

My current place of work likes private and protected methods to be YARD documented with types.

Can I request an additional parameter to apply the Cop to either public or all methods?

qnm commented Jul 28, 2016

This is a great feature, thanks!

Yes, we can certainly implement something like this. Although it should probably check only public methods.

I generally agree - however depending on local coding standards, this should be configurable.

My current place of work likes private and protected methods to be YARD documented with types.

Can I request an additional parameter to apply the Cop to either public or all methods?

@Drenmi

This comment has been minimized.

Show comment
Hide comment
@Drenmi

Drenmi Jul 28, 2016

Collaborator

@qnm: Of course! Please open a new issue with a feature request. 😀

Collaborator

Drenmi commented Jul 28, 2016

@qnm: Of course! Please open a new issue with a feature request. 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment