Wrong lint fix indentation
gabrieltimisica1 opened this issue · 2 comments
gabrieltimisica1 commented
Hello.
I'm seeing some weird updates to the code after running the following command:
npm-groovy-lint src/** vars/** test/** --rulesets "config/codenarc/codenarc.xml" --fix
I'm using npm-groovy-lint@13.0.2 with Node@18.15.0
I added some attachments to show the issue.
This is my configuration
<ruleset xmlns="http://codenarc.org/ruleset/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codenarc.org/ruleset/1.0 http://codenarc.org/ruleset-schema.xsd"
xsi:noNamespaceSchemaLocation="http://codenarc.org/ruleset-schema.xsd">
<description>rule set</description>
<ruleset-ref path="rulesets/formatting.xml">
<rule-config name="ClassEndsWithBlankLine">
<property name="blankLineRequired" value="true"/>
</rule-config>
<rule-config name="Indentation">
<property name="spacesPerIndentLevel" value="4"/>
</rule-config>
<rule-config name="LineLength">
<!-- codenarc also includes tabs which == 4 spaces in the calculation of the line length-->
<property name="length" value="170"/>
<property name="ignoreLineRegex" value="[^\/\/(.)*]"/>
</rule-config>
<rule-config name="SpaceAroundMapEntryColon">
<property name="characterAfterColonRegex" value="[/\s/]"/>
</rule-config>
<exclude name="MissingBlankLineBeforeAnnotatedField"/>
</ruleset-ref>
<ruleset-ref path='rulesets/imports.xml'>
<rule-config name='DuplicateImport'>
<property name='priority' value='1'/>
</rule-config>
<rule-config name="NoWildcardImports">
<property name="ignoreImports" value='true'/>
<property name="ignoreStaticImports" value='true'/>
</rule-config>
</ruleset-ref>
<ruleset-ref path="rulesets/unused.xml">
<rule-config name="UnusedPrivateMethod">
<property name="ignoreMethodsWithAnnotationNames" value="Deprecated"/>
</rule-config>
</ruleset-ref>
<ruleset-ref path='rulesets/basic.xml'>
<exclude name='StringInstantiation'/>
<exclude name='ThrowExceptionFromFinallyBlock'/>
<exclude name='ReturnFromFinallyBlock'/>
</ruleset-ref>
</ruleset>
stevenh commented
Do you have a code snippet you can share to demonstrate this?
github-actions commented
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.