-1

I want to include the PSR12 ruleset (which includes the rule "PSR1.Methods.CamelCapsMethodName.NotCamelCaps") but I don't want that rule to run on a specific file. so I tried the following ruleset:

<rule ref="PSR12">
    <exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
</rule>

<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
    <exclude-pattern>packages/test/file</exclude-pattern>
</rule>

Unfortunately, it doesn't run the "PSR1.Methods.CamelCapsMethodName.NotCamelCaps" rule at all (also not in the rest of the code).

Does anyone know how to get this working?

2 Answers2

1

As @Greg Sherwood gave the solution: I could just remove the tag from the PSR12 rule.

<rule ref="PSR12">
</rule>

<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
    <exclude-pattern>packages/test/file</exclude-pattern>
</rule>
0

you can also try this....

<rule ref="PSR12">
      <exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
</rule>

The path of this You find out from /usr/share/php/PHP/CodeSniffer/Standards/PSR1/Docs/Methods