Open berthin opened 2 weeks ago
After looking at https://github.com/nvuillam/npm-groovy-lint/blob/main/lib/rules/IndentationComments.js, I think the heuristic rule to indent comments is wrong. It's purely based on the indentation of the next line, which means:
def function() {
// some comment
}
will be indented as:
def function() {
// some comment
}
what I'd expect is
def function() {
<N spaces>// some comment
}
where N is specified by the RC file.
Hi,
using the pre-commit hook
format-npm-groovy-lint
, comments are not formatted correctly. See for instance the following example:the comments are indented with 6 spaces, the groovy linter rc file specifies a 2 space indentation, but the pre-commit hook doesn't complain.
I am using this pre-commit configuration
Another thing I found is if I add comments at the end of the function:
then, the formatter decreases the alignment by 1
Not sure if this by design, or a bug.