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

FunctionBodyLengthRule should not count comment lines #258

Closed
proth opened this issue Dec 11, 2015 · 4 comments
Closed

FunctionBodyLengthRule should not count comment lines #258

proth opened this issue Dec 11, 2015 · 4 comments
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@proth
Copy link

proth commented Dec 11, 2015

lines that start with a "//" after removing all leading whitespaces should not be treated as line inside a function. Otherwise the obvious way to fix violations of that rule would be to write less comments.

@ghost
Copy link

ghost commented Dec 11, 2015

+1.

It should also ignore headerdoc documentation comments.

@jpsim
Copy link
Collaborator

jpsim commented Dec 11, 2015

I like this idea.

lines that start with a "//" after removing all leading whitespaces should not be treated as line inside a function. Otherwise the obvious way to fix violations of that rule would be to write less comments.

SwiftLint can actually detect all kinds of comments (//, /* */, ///, /** */), so really we could just not count lines that only have comment-like tokens.

@jpsim jpsim added the enhancement Ideas for improvements of existing features and rules. label Dec 11, 2015
@kevindelord
Copy link

+1

Looks even better with all kind of comments: //, /* */, ///, /** */

@scottrhoyt
Copy link
Contributor

+1 here. I've already adapted some of my commenting style to avoid this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

No branches or pull requests

4 participants