Skip to content
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

fix: NoSpaceAroundDoubleColonFixer must run before MethodChainingIndentationFixer #7723

Merged
merged 5 commits into from Jan 14, 2024
Merged

fix: NoSpaceAroundDoubleColonFixer must run before MethodChainingIndentationFixer #7723

merged 5 commits into from Jan 14, 2024

Conversation

mho22
Copy link
Contributor

@mho22 mho22 commented Jan 13, 2024

Fixes #7699.

@mho22
Copy link
Contributor Author

mho22 commented Jan 13, 2024

@Wirone Considering the minor changes that were added, the static code analysis check seems a bit peculiar.

@Wirone
Copy link
Member

Wirone commented Jan 13, 2024

@mho22 hard to tell, does it work correctly when you execute composer qa locally?

@mho22
Copy link
Contributor Author

mho22 commented Jan 13, 2024

@Wirone No, indeed.

I get this error

PHP-CS-Fixer [master] composer qa
> Composer\Config::disableProcessTimeout
> ./dev-tools/check_file_permissions.sh
"php-cs-fixer" is executable
No wrong permissions detected.
> ./dev-tools/check_trailing_spaces.sh
Trailing whitespaces detected:
tests/Fixer/Phpdoc/PhpdocAlignFixerTest.php:697:     * @param mixed    $bar    Description word_with_ą
tests/Fixer/Phpdoc/PhpdocAlignFixerTest.php:704:     * @SuppressWarnings(PHPMD.UnusedLocalVariable) word_with_ą
tests/Fixer/Phpdoc/PhpdocAlignFixerTest.php:714:     * @param mixed $bar Description word_with_ą
tests/Fixer/Phpdoc/PhpdocAlignFixerTest.php:721:     *   @SuppressWarnings(PHPMD.UnusedLocalVariable) word_with_ą
tests/Fixer/Phpdoc/PhpdocTrimFixerTest.php:54: * @return int количество деактивированных
tests/Fixer/Phpdoc/PhpdocTrimFixerTest.php:66: * Test à
tests/Fixer/Whitespace/NoTrailingWhitespaceFixerTest.php:95:garçon, si bien qu'il ne savait s'il fallait garder sa casquette à
Script ./dev-tools/check_trailing_spaces.sh handling the self-check event returned with error code 3
Script @self-check was called via quality-assurance
Script @quality-assurance was called via qa

I managed to bypass the error using composer test:integration.

I have the same error when cloning the repo [ with those steps ] :

git clone https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git

composer install

composer qa

@Wirone
Copy link
Member

Wirone commented Jan 13, 2024

There are many Composer scripts that are building blocks for qa. Looking at the pipeline here, you should locally look at composer auto-review and composer test. In general, you should be able to pass the whole QA suite locally to be able to effectively work with Fixer.

@mho22
Copy link
Contributor Author

mho22 commented Jan 13, 2024

@Wirone I think the CI could possibly be broken by some unrelated change - as indicated in another recent PR comment ? : #7724 (comment)

@coveralls
Copy link

coveralls commented Jan 14, 2024

Coverage Status

coverage: 94.805%. remained the same
when pulling d252f76 on mho22:7699-fix-priority-no-space-around-double-colon
into 6d57705 on PHP-CS-Fixer:master.

@mho22
Copy link
Contributor Author

mho22 commented Jan 14, 2024

@Wirone I've finally passed all the checks. Thanks for following up.

Copy link
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.

FYI: before this PR the result of using those 2 rules depended on the way how Fixer was executed - you could have 2 different outcomes depending on the order of the rules:

image

After this PR it does not matter in which order rules are added to the final ruleset, their priorities determine the actual order.

@Wirone Wirone changed the title fix: NoSpaceAroundDoubleColonFixer should run before MethodChainingIndentationFixer fix: NoSpaceAroundDoubleColonFixer must run before MethodChainingIndentationFixer Jan 14, 2024
@Wirone Wirone merged commit 9922e5b into PHP-CS-Fixer:master Jan 14, 2024
25 checks passed
@Wirone
Copy link
Member

Wirone commented Jan 14, 2024

Thank you @mho22 🍻!

@mho22 mho22 deleted the 7699-fix-priority-no-space-around-double-colon branch January 14, 2024 16:07
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

method_chaining_indentation should be executed after no_space_around_double_colon
3 participants