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

check the comments or document before each function? #2968

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

check the comments or document before each function? #2968

ahuang opened this issue Mar 21, 2016 · 4 comments

Comments

@ahuang
Copy link

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
Copy link
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
Copy link
Author

ahuang commented Mar 22, 2016

thanks! @bbatsov

sooyang pushed a commit to sooyang/rubocop that referenced this issue Jul 27, 2016
@qnm
Copy link

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
Copy link
Collaborator

Drenmi commented Jul 28, 2016

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

Neodelf pushed a commit to Neodelf/rubocop that referenced this issue Oct 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants