#93 Multi line comments (indentation)

open
nobody
None
1
2012-10-10
2002-08-03
No

Ref Bug: 574759


hi,
In my project, different developers use different IDEs and
we are
trying to use checkstyle to ensure that all of us conform
to the
same coding standards.
I found that multi-line comments that look like this:
/
First line
Second line
Third line
/
are not complained about by checkstyle. Is it possible
to check
for these and report them as warnings?
I personally use eclipse and when I run the format
command, it
will format the above lines correctly - but I would
appreciate it if
checkstyle could show a warning in the task area.

Thanks
Vijay


Comment By: Lars Kühne (lkuehne)
Date: 2002-06-11 15:14

Message:
Logged In: YES
user_id=401384

Just to make sure that I'm not confused by the SF
HTML code:
I assume you mean that text line should be indented in
such
a way that the '' charcters in the continuation line
match
the first (second?) '
' character in the start of the
comment.

This would be a nice new feature, but it was never on the
list of checks that Checkstyle performs, so Checkstyle
works
"as advertized". Vijay, to keep our database clean,
please
close this bug and recommit this as a feature request.
I'd
do it myself, but then you would loose control of your
request.

I don't know Eclipse, I assume that it differenciates
between warnings and errors. Checkstyle doesn't do
that,
everything is an error (maybe the Eclipse plugin
presents
all errors as warnings). If you want to differenciate
between warnings and errors please record a separate
feature
request for that (include some criteria what should be a
warning and what should be an error).

Thanks,
Lars

Discussion

  • Tim Tyler
    Tim Tyler
    2003-06-13

    Logged In: YES
    user_id=796025

    I've written a check to do this:

        <module name="CommentStarAlignmentCheck">
            <property name="extraIndentForJavadoc"
    

    value="true"/>
    </module>

    The "extraIndentForJavadoc" can be used to choose
    between these two styles:

    /*
    * Foo
    /

    /*
    * Bar

    /

    The check only fires if every single line of the comment starts
    with an asterisk.

    If that is not true, it assumes you are commenting out a
    block of code (or something) and remains silent.

     
  • Logged In: YES
    user_id=746148

    493369 (Check comment line starts) closed as duplicate of
    this rfe