npm-groovy-lint icon indicating copy to clipboard operation
npm-groovy-lint copied to clipboard

Wrong lint fix indentation

Open gabrieltimisica1 opened this issue 1 year ago • 2 comments

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 [email protected] with [email protected]

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>

Screenshot 2023-12-14 at 11 51 17 Screenshot 2023-12-14 at 11 51 34 Screenshot 2023-12-14 at 11 52 05

gabrieltimisica1 avatar Dec 14 '23 10:12 gabrieltimisica1

Do you have a code snippet you can share to demonstrate this?

stevenh avatar Dec 18 '23 12:12 stevenh

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.

github-actions[bot] avatar Mar 04 '24 01:03 github-actions[bot]