-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent PHPCS from scanning markdown files. #2824
Conversation
@aweingarten you mentioned Twig in the issue but excluded md files in the PR. Was this intentional? Should we also add .twig? |
@aweingarten ping? |
@mikemadison13 this was intended just to cover markdown. Title has been updated! |
@aweingarten i still only see .md files in the patch. if you want to cover just twig, .twig needs to be added |
@@ -34,5 +34,6 @@ | |||
<exclude-pattern>*/node_modules</exclude-pattern> | |||
<exclude-pattern>*/vendor</exclude-pattern> | |||
<exclude-pattern>*/default.local.settings.php</exclude-pattern> | |||
<exclude-pattern>*md</exclude-pattern> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a section above which may be a better fit...?
<arg name="ignore" value="*.css,*.md,*.txt"/>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this pattern is too broad. I'd have to verify, but I expect that a directory named shazamd
would also have its contents ignored with this. As dpagini pointed out, previous sections use a *.md
pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've confirmed by suspicion. With the <exclude-pattern>*md</exclude-pattern>
rule, if I put an improperly formatted css file inside a directory named shabamd
(or anything else ending in md, phpcs stops seeing the css file. If I then rename the directory to shabam
, phpcs sees the css file again.
I just ran into a similar problem with BLT 9.0... It seems like when I have ...I'm wondering if the solution for that would be something similar as this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rule as written is too broad and will exclude things other than markdown files.
It looks to me like the test really needs to be |
this should be covered in 10.x already, see https://github.com/acquia/blt/blob/10.0.x/phpcs.xml.dist#L11 |
Changes proposed:
https://www.drupal.org/node/2867601#comment-12075633