-
Notifications
You must be signed in to change notification settings - Fork 196
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 php-cs-fixer and pre-commit hook installer #4465
Merged
Merged
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
This was referenced Aug 10, 2022
agustinbusso
approved these changes
Aug 16, 2022
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.
Seems to be working as expected. Working using the terminal and github desktop for mac:
Test in core
When you run php-cs-fixer fix
the first time, it takes some time as you can see in the video. Maybe because is not cached at this moment.
Screen.Recording.2022-08-16.at.13.25.05.mov
Test in package
Screen.Recording.2022-08-16.at.13.23.39.mov
This was referenced Aug 16, 2022
agustinbusso
approved these changes
Aug 19, 2022
ryancooley
approved these changes
Aug 23, 2022
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.
Issue & Reproduction Steps
As part of the Laravel upgrade process, we will be formatting all PHP code to follow code standards rules. We need a way to enforce these standards going forward after the initial fix for all files.
Solution
Relevant Files:
All other changes in this PR are formatting changes from php-cs-fixer
Packages should not need any updates other than .gitignore and the initial formatting.
The hooks are installed when composer dump-autoload runs in core. This happens automatically after composer install/require/update. For packages, this creates symlinks to the hook and config file in core. It works fine on my Mac but not sure how it will behave on other systems.
Eventually this should run in CI but it's important to have it here too for fast feedback.
Before final approval and merge
Run php-cs-fixer in this branch and package branches to fix any changes that have been merged since the PR was opened and commit the results.
How to Test
composer global require friendsofphp/php-cs-fixer
feature/FOUR-6588
and runcomposer install
. This should install the git pre-commit hooks.feature/FOUR-6588
branch of package-webentry. This branch has the formatting changes already appliedRelated Tickets & Packages
Helpful links
List of package PRs
https://github.com/ProcessMaker/connector-pdf-print/pull/55
ProcessMaker/nayra#218
ProcessMaker/pmql#29
https://github.com/ProcessMaker/connector-docusign/pull/27
https://github.com/ProcessMaker/connector-slack/pull/17
https://github.com/ProcessMaker/package-actions-by-email/pull/81
https://github.com/ProcessMaker/package-advanced-user-manager/pull/25
https://github.com/ProcessMaker/package-auth/pull/62
https://github.com/ProcessMaker/package-collections/pull/320
https://github.com/ProcessMaker/package-comments/pull/80
https://github.com/ProcessMaker/package-conversational-forms/pull/41
https://github.com/ProcessMaker/package-data-sources/pull/240
https://github.com/ProcessMaker/package-webentry/pull/161
https://github.com/ProcessMaker/connector-send-email/pull/212
https://github.com/ProcessMaker/package-dynamic-ui/pull/60
https://github.com/ProcessMaker/package-files/pull/85
https://github.com/ProcessMaker/package-googleplaces/pull/32
https://github.com/ProcessMaker/package-process-documenter/pull/21
https://github.com/ProcessMaker/package-process-optimization/pull/13
https://github.com/ProcessMaker/package-savedsearch/pull/324
https://github.com/ProcessMaker/package-sentry/pull/7
https://github.com/ProcessMaker/package-signature/pull/27
https://github.com/ProcessMaker/package-translations/pull/46
https://github.com/ProcessMaker/package-versions/pull/53
https://github.com/ProcessMaker/package-vocabularies/pull/63
https://github.com/ProcessMaker/packages/pull/11
https://github.com/ProcessMaker/package-ellucian-ethos/pull/68
ProcessMaker/docker-executor-php#15
https://github.com/ProcessMaker/docker-executor-node-ssr/pull/2
ProcessMaker/docker-executor-csharp#5
ProcessMaker/docker-executor-java#4
ProcessMaker/docker-executor-r#4
https://github.com/ProcessMaker/docker-executor-python-selenium/pull/1
https://github.com/ProcessMaker/docker-executor-python/pull/1
ProcessMaker/docker-executor-node#8
https://github.com/ProcessMaker/docker-executor-migration-tools/pull/37
ProcessMaker/docker-executor-lua#7
Code Review Checklist