Skip to content

Conversation

jonathan1055
Copy link
Contributor

Do not run Generic.PHP.DisallowShortOpenTag on .yml files
Drupal issue https://www.drupal.org/project/coder/issues/3535411

<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.PHP.DisallowShortOpenTag">
<!-- Do not run this sniff on .yml files -->
<exclude-pattern>**/*.yml</exclude-pattern>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why we need **? Other exclusions in this file just use <exclude-pattern>*.tpl.php</exclude-pattern>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um, no. It's 3 months ago and I can't recall why I did it like that! Maybe I did not look at the rest of the file and just used a pattern that I thought was necessary. Other filepath patterns need a double ** (eg ESLint ignore, I think). I didn't do too much testing at the time, as I had no idea if you would take on this suggestion. Now that I know it's on, I will add test coverage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed the double ** and added a good/good.yml file to demonstrate the failure, then the fix.

@klausi klausi merged commit 680f480 into pfrenssen:8.3.x Oct 14, 2025
8 checks passed
@jonathan1055 jonathan1055 deleted the 3535411-exclude-sniffs-from-yml branch October 14, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants