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

Unexpected missing top-level module documentation comment #947

Closed
fabiopelosin opened this issue Apr 3, 2014 · 11 comments
Closed

Unexpected missing top-level module documentation comment #947

fabiopelosin opened this issue Apr 3, 2014 · 11 comments

Comments

@fabiopelosin
Copy link
Contributor

This report is relative to the Documentation cop. The output of Rubocop is the following:

$ rubocop --version
0.20.0
$ rubocop
Inspecting 38 files
..C................C...CCC.....C......

Offenses:

lib/cocoapods-core/gem_version.rb:1:1: C: Missing top-level module documentation comment.
module Pod
^^^^^^
[...]

The module Pod is commented here and the file which lead to the warning is this one.

Is this the intended behaviour?

@yujinakayama
Copy link
Collaborator

It's not intended but currently RuboCop cannot handle state between multiple files.

See: #323

@fabiopelosin
Copy link
Contributor Author

Thanks for the reply. In my usage case this is unfortunate because RuboCop is used to fail the CI build with any violation so this means that this module cannot be enabled.

Although state between files is a very desirable feature, there would be another alternative to fix the
Documentation while keeping things pretty simple: allow to disable the top-level module documentation check.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 4, 2014

Maybe such an option would make sense. Alternatively we can add constants to our namespace module check. Modules that are considered namespaces by RuboCop are not required to have documentation.

@segiddins
Copy link
Contributor

Any update on this @bbatsov ?

@bbatsov
Copy link
Collaborator

bbatsov commented Jul 20, 2014

I've been quite busy lately and I haven't tackled this yet.

@dmolesUC
Copy link
Contributor

It would be nice to separate the class and module documentation checks, at least.

@segiddins
Copy link
Contributor

Might it make sense to allow namespaces that have only constant children of any kind (Class, Module, Constant) to be undocumented?

@alexdowad
Copy link
Contributor

Might it make sense to allow namespaces that have only constant children of any kind (Class, Module, Constant) to be undocumented?

This is very easy to implement. But do the maintainers want it? @bbatsov @jonas054

@jonas054
Copy link
Collaborator

Slightly expanding what we mean by namespace module. I'd be ok with that.

@alexdowad
Copy link
Contributor

OK, sounds like @jonas054 likes the idea, at least a little bit. Almost all the specs for this cop will have to be adjusted. But that's OK.

@alexdowad
Copy link
Contributor

Pushed a fix to my open PR. @bbatsov, if you decide that classes/modules with only constants are not "namespaces", I will delete that commit from the PR.

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

No branches or pull requests

7 participants