Skip to content

Configure different standards per folder #3863

Answered by jrfnl
mafeka asked this question in Q&A
Discussion options

You must be logged in to vote

I'm thinking you may be able to achieve this using well-configured <include-pattern>s, but I haven't tested it.

Something along the lines of:

<file>.</file>

<rule ref="Custom">
    <include-pattern>./[^/]+\.php</include-pattern><!-- Files in the project root. -->
    <include-pattern>./subfolder-2/</include-pattern>
</rule>

<rule ref="PSR12">
    <include-pattern>./subfolder-[13]{1}/</include-pattern>
</rule>

Note: you won't be able to set different property settings for the same sniff for different folders, so your mileage may vary. (tracked in #2258)

Hope this helps.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mafeka
Comment options

Answer selected by mafeka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants