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

Add rector config #48223

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add rector config #48223

wants to merge 2 commits into from

Conversation

come-nc
Copy link
Contributor

@come-nc come-nc commented Sep 19, 2024

Summary

And so it begins…

  1. Added rector in a vendor-bin
  2. Added a mostly-empty configuration
  3. Applied to apps folder

Long term goal is to apply rectors from https://github.com/nextcloud-libraries/rector to core code. We’ll need to be extra careful with folders like lib/public because they use some deprecated stuff on purpose I think.
So not sure if the best way forward is to add more rules or more folders.

Checklist

Only applying on apps for now, and only minimal type coverage level.

Signed-off-by: Côme Chilliet <[email protected]>
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

Can you add a script like https://github.com/nextcloud/groupfolders/blob/532f734b9d729a3c29a7371faf0bb85a24e0b311/composer.json#L26? This makes it a lot easier to use rector.

Comment on lines +23 to +28
->withSkip([
__DIR__ . '/apps/*/3rdparty/*',
__DIR__ . '/apps/*/build/stubs/*',
__DIR__ . '/apps/*/composer/*',
__DIR__ . '/apps/*/config/*',
])
Copy link
Member

Choose a reason for hiding this comment

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

Please put this into the first commit

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

Psalm found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.


return RectorConfig::configure()
->withPaths([
__DIR__ . '/apps',
Copy link
Member

Choose a reason for hiding this comment

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

Make sure to exclude any git ignored paths like cs-fixer

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants