fix: use npm run re:format with git diff check #3708
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.
Type of Change
Description
Added a ReScript formatter check to the CI/CD pipeline to ensure consistent code formatting across the codebase.
Changes made:
.github/workflows/formatter-check.ymlworkflow filenpm run re:formatto format filesMotivation and Context
This change addresses issue #3559.
Problem:
Currently, the project does not have an automated check in the CI/CD pipeline to ensure that code is formatted with the ReScript formatter. This leads to:
Solution:
By integrating a formatter check into the pipeline, we can automatically verify formatting during pull requests and enforce consistency across the project.
How it works:
npm run re:formatin the CI environmentgit status --porcelainCloses #3559
How did you test it?
Testing performed:
npm run re:formatnpx rescript format -all -checkExpected CI behavior:
Where to test it?
Checklist
npm run re:buildAdditional Notes
For Developers:
To check formatting locally before pushing:
The CI check will ensure all ReScript files (
.resand.resi) are properly formatted according to ReScript's standard formatting rules.