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

Blank lines in multiline comments counted as blanks #275

Open
alekratz opened this issue Oct 11, 2018 · 2 comments
Open

Blank lines in multiline comments counted as blanks #275

alekratz opened this issue Oct 11, 2018 · 2 comments
Labels

Comments

@alekratz
Copy link
Contributor

If a multiline comment contains blank lines, those lines get counted as "blank" instead of being part of the multiline comment. For example:

/* blank lines follow







   */

will yield this output (using .rs extension for sake of example):

 Language                          Files        Lines         Code     Comments       Blanks
---------------------------------------------------------------------------------------------
 Rust                                  1            9            0            2            7

Is this intended behavior? While the lines are technically blank, they are also a part of the multiline comment.

@XAMPPRocky
Copy link
Owner

Thank you for this issue. While I can see the case for them being comments the question I would wonder if syntactically are these blank lines significant in any language, such that counting them as blanks is an unintuitive behaviour?

@jakwings
Copy link

I think those blank lines should still be comments.

Blank lines in strings should also be counted as code.

My argument is: it is just like how people put {, }, [, ], (, ) on a single line (and lose some contests!) no matter how insignificant it seems.

echo '{
 M
  Y

     S
      T
       Y
        L
         E
}'

Blank lines in comments can also be used by document generators (e.g. as divider) but still is part of the comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants