script to format pull requests #13414
Closed
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.
a script to format pull requests.
related conversation: https://github.com/php/php-src/pull/13401/files/d64a8ccdc1d21576827059ee86c0fa073c95ffcc#r1492699756
requirements: git, clang-format, php-cli.
usage: make sure your git working dir is clean (like "git reset --hard" clean) and run
and if the pull request is not properly formatted, you should get a diff like
huh look at that, seems PR #13401 isn't properly formatted, i should do something about that.
This script is manual right now, but ideally it should be an automated part of a CI test, where a failed test can give a link to a diff file, so people can fix it by just running
fwiw StyleCI does something similar (but does not support C): https://styleci.io/