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
feat: Handle deprecated rule sets similarly to deprecated fixers #7288
Merged
Wirone
merged 7 commits into
PHP-CS-Fixer:master
from
Wirone:codito/7285-deprecation-contract-for-rulesets
Dec 15, 2023
Merged
feat: Handle deprecated rule sets similarly to deprecated fixers #7288
Wirone
merged 7 commits into
PHP-CS-Fixer:master
from
Wirone:codito/7285-deprecation-contract-for-rulesets
Dec 15, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keradus
reviewed
Sep 12, 2023
keradus
reviewed
Sep 12, 2023
keradus
reviewed
Sep 12, 2023
keradus
reviewed
Sep 12, 2023
keradus
reviewed
Sep 12, 2023
keradus
reviewed
Sep 12, 2023
Wirone
force-pushed
the
codito/7285-deprecation-contract-for-rulesets
branch
from
September 26, 2023 17:02
1d39cf2
to
18ad8b1
Compare
localheinz
reviewed
Sep 27, 2023
Wirone
force-pushed
the
codito/7285-deprecation-contract-for-rulesets
branch
from
December 14, 2023 12:26
18ad8b1
to
ff049a5
Compare
Wirone
commented
Dec 14, 2023
@@ -2,8 +2,6 @@ | |||
Rule set ``@PER-CS1.0`` | |||
======================= | |||
|
|||
**This ruleset is deprecated** in favour of ``@PER-CS2.0``. |
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 removed this because we should not deprecate @PER-CS1.0
which is valid rule set, just like we don't deprecate @PSR1
, @PSR2
or @PSR12
.
Wirone
force-pushed
the
codito/7285-deprecation-contract-for-rulesets
branch
from
December 14, 2023 15:42
41cad90
to
9ffba27
Compare
kubawerlos
approved these changes
Dec 15, 2023
Format was taken from fixers' docs, but I decided to not display `risky` attribute next to risky rule sets, because all of them already have this information in their name.
Deprecation warnings can't be handled with PHPUnit's expectation API when they're triggered in the provider. But we can ignore them in Symfony's PHPUnit bridge if we mark test or provider as legacy. https://symfony.com/doc/current/components/phpunit_bridge.html#mark-tests-as-legacy
Only rulesets that are actually invalid and must be removed should be marked as deprecated. In our case it's `@PER` and `@PER:risky` because the name was invalid and they were re-introduced as `@PER-CS` and `@PER-CS:risky`. Additionally, the inheritance tree was changed and `@PER` now extends `@PER-CS` instead of `@PER-CS2.0` (deprecated alias ruleset pointing to proper alias ruleset).
Deprecated rulesets are part of several tests' cases, and every time such deprecated ruleset is used, it triggers deprecation notice which causes PHPUnit's failure (require Symfony Bridge's trait included in test case class to work properly).
Wirone
force-pushed
the
codito/7285-deprecation-contract-for-rulesets
branch
from
December 15, 2023 15:09
9ffba27
to
aaadad8
Compare
danog
pushed a commit
to zoonru/PHP-CS-Fixer
that referenced
this pull request
Feb 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #7285.