Unable to disable indentation formatting
logicbomb421 opened this issue · 3 comments
It seems indentation is a common issue among users of CodeNarc, which I am aware this tool uses under the hood.
Our team has elected to disable the indentation rules entirely sine they are currently producing some odd results. However, when setting enabled: false
for this rule, indentation is still modified on a call using --fix
or --format
.
For example, consider the following .groovylintrc.json
file:
{
"extends": "recommended",
"rules": {
"Indentation": {
"enabled": false
}
}
}
and the following Groovy snippet:
int example(int arg) {
if (arg == 1
|| arg == 2
|| arg == 3) {
print(arg)
} else {
print(-1)
}
}
When running the linter with npm-groovy-lint example.groovy --fix
(or --format
), the closing brace under else
is still reformatted even though indentation should be disabled:
if (arg == 1
|| arg == 2
|| arg == 3) {
print(arg)
} else {
print(-1)
}
I have tried formatting.Indentation
in the config file, though that also does not change anything.
How can I disable indentation linting and formatting using this tool?
Thank you!
GroovyLint: Successfully processed CodeNarc:
CodeNarc version 3.3.0
npm-groovy-lint version 14.6.0
Embeds:
CodeNarc version 3.3.0
- Groovy version 3.0.9 (superlite)
This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
@logicbomb421 please can you run DEBUG=npm-groovy-lint npm-groovy-lint ...
and share the log ?
It will tell use which rule has played with Indentation (there are other rules that can impact it)
This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.