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(cs-fixer): Correctly ignore files ignored by git #47474

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

provokateurin
Copy link
Member

@provokateurin provokateurin commented Aug 25, 2024

Summary

Many files ignored by git were never ignored by cs-fixer due to symfony/symfony#37781.
If it was actually working as intended, then the code for ignoring the additional app directories wouldn't have been necessary.

This implementation is more generic and really ignores the files ignored by git.
Instead of scanning 7075 files (also from additional apps, your count will be different) it only has to scan 4493.
While being faster, this also stops cs-fixer from messing with formatting in additional apps, if they were placed in the apps/ directory.

I manually added back the ignores for build/stubs and composer since we don't control or care about their content formatting wise.
As for the config dir, we might want to remove the exclusion and have the config.sample.php correctly formatted. Let me know if I should change that.

According to https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/config.rst#configuring-paths the notPath calls were also wrong because they are only for files and exclude should have been used instead.

Checklist

Signed-off-by: provokateurin <kate@provokateurin.de>
@provokateurin provokateurin added bug 3. to review Waiting for reviews labels Aug 25, 2024
@provokateurin provokateurin added this to the Nextcloud 31 milestone Aug 25, 2024
@provokateurin provokateurin requested review from nickvergessen, ChristophWurst, kesselb, a team, Altahrim, Fenn-CS and yemkareems and removed request for a team August 25, 2024 18:50
Copy link
Contributor

@kesselb kesselb left a comment

Choose a reason for hiding this comment

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

Nice one

@provokateurin provokateurin merged commit c42412f into master Aug 26, 2024
171 checks passed
@provokateurin provokateurin deleted the fix/cs-fixer/ignore-git-ignored-entries branch August 26, 2024 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants