jcberquist / commandbox-cfformat

A CommandBox module for formatting CFML component files.
MIT License
21 stars 10 forks source link

Formatter breaks on some blocked comments #97

Closed rbreaves closed 3 years ago

rbreaves commented 3 years ago

Not a hard break or anything it just ignores the comment block if it is not what it expects I suppose.

If there is any asterisks lacking in a comment block instead of correcting it it completely ignores the block thus proper indentation will not be applied.

{
    /**
      a comment
     */
}

That's still a valid comment, but the cfformatter won't touch it.

jcberquist commented 3 years ago

If I understand your issue correctly, this is expected behavior. By default, cfformat checks block comments to see if all lines begin with a *, and if so, aligns them (see reference.md#commentasterisks). Otherwise, it preserves the indent levels of the comment (similar to the contents of strings).

rbreaves commented 3 years ago

Yea, this may be more of a thing for cflinter to help resolve now that I think about it. I will close this ticket.