Skip to content

feat: exception for rules via @php-cs-fixer-ignore annotation#9280

Merged
keradus merged 29 commits intomasterfrom
filter_by_tag
Dec 12, 2025
Merged

feat: exception for rules via @php-cs-fixer-ignore annotation#9280
keradus merged 29 commits intomasterfrom
filter_by_tag

Conversation

@keradus
Copy link
Copy Markdown
Member

@keradus keradus commented Dec 10, 2025

complements #9107

@keradus
Copy link
Copy Markdown
Member Author

keradus commented Dec 10, 2025

@mlocati can you take a look please?

this is what i meant here

I believe having 2 options makes sense here, to cover both, complex situations but also trivial ones

@keradus keradus marked this pull request as ready for review December 10, 2025 10:31
@keradus keradus changed the base branch from master to docs December 10, 2025 10:40
@coveralls
Copy link
Copy Markdown

coveralls commented Dec 10, 2025

Coverage Status

coverage: 93.171% (-0.02%) from 93.186%
when pulling f1fd01f on filter_by_tag
into 21bae5b on master.

Base automatically changed from docs to master December 10, 2025 10:48
# Conflicts:
#	doc/rules_exceptions.rst
@mlocati
Copy link
Copy Markdown
Contributor

mlocati commented Dec 10, 2025

Yep, this will be very useful!

Can you try to add this test case to FixerTagAnalyzerTest::provideFindCases()?

<?php

// @php-cs-fixer-ignore no_binary_string Ignore because of reasons

That way we are sure that the same comment isn't detected as duplicated when the file doesn't have code.

@keradus
Copy link
Copy Markdown
Member Author

keradus commented Dec 10, 2025

makes sense, added

@keradus
Copy link
Copy Markdown
Member Author

keradus commented Dec 10, 2025

@mlocati i reused the validation/ensuring rules with declared exceptios are indeed supposed to be used.

mind to do a review and give a green flag, if good ?

Comment thread doc/rules_exceptions.rst Outdated
Copy link
Copy Markdown
Member

@Wirone Wirone left a comment

Choose a reason for hiding this comment

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

Quick feedback without deep diving, important to address before merge/release.

Comment thread doc/rules_exceptions.rst Outdated
Comment thread src/Tokenizer/Analyzer/FixerAnnotationAnalyzer.php
Comment thread src/Tokenizer/Analyzer/FixerTagAnalyzer.php Outdated
@keradus keradus merged commit 071db5a into master Dec 12, 2025
34 checks passed
@keradus keradus deleted the filter_by_tag branch December 12, 2025 10:23
stakovicz pushed a commit to stakovicz/PHP-CS-Fixer that referenced this pull request Jan 4, 2026
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.

4 participants