melix / codenarc-idea

11 stars 10 forks source link

Do not apply to file / files matching not working #59

Closed itd-dha closed 1 year ago

itd-dha commented 1 year ago

Hi,

I have the feeling the "Do not apply to file names" and "Do not apply to files matching" input is not working in IntelliJ. I want to exclude the "build.gradle" file in my root folder from CodeNarcs Formatting rules, but everything I try, I can not get this file ignored other then deactivating the whole rule.

Rule: Closure statement on opening line of multiple line closure

Tested: Do not apply to file names:

Do not apply to files matching:

IntelliJ Version: 2021.2.4 CodeNarc Plugin Version: 4.4.0

Any idea what I am doing wrong? Do I have to switch to Beta channel and get a newer version of plugin?

musketyr commented 1 year ago

Hi, sorry for a late reply.

Yes, you should try the beta channel to get the newest version of the plugin. Let me know if the issue still persist with the latest version.

itd-dha commented 1 year ago

Hi, thanks for your answer.

I switched to beta channel and updated the plugin, still the problem remains:

Example: -> In settings I set file or matches to ignore rule "Block starts with empty line" for build.gradle -> Intellij writes the following to my Intellij profile

<inspection_tool class="CodeNarc.BlockStartsWithBlankLine" enabled="true" level="SERVER PROBLEM" enabled_by_default="true">
    <option name="doNotApplyToFileNames" value="build.gradle" />
    <option name="doNotApplyToFilesMatching" value="[a-zA-Z0-9]*.gradle" />
</inspection_tool>

But still it finds this rule in my build.gradle grafik

For matching file I tested "build" or "gradle" For matching regex I tested "(.).gradle" or "..gradle" Same result.

itd-dha commented 1 year ago

Wow, thanks for your time fixing this, I will test it out right away!