-
Notifications
You must be signed in to change notification settings - Fork 4
chore: Add Prettier formatting validation to CI pipeline #454
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
chore: Add Prettier formatting validation to CI pipeline #454
Conversation
Co-authored-by: jonathan <[email protected]>
package.json
Outdated
| "lint": "eslint . --ext .ts --config .eslintrc", | ||
| "postpack": "shx rm -f oclif.manifest.json", | ||
| "posttest": "yarn lint", | ||
| "posttest": "yarn lint && yarn format:check", |
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.
should this be pretest instead of post?
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.
its probably fine to run the tests first as this won't change functionality.
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.
mostly concerned that this will "fail" the build / task, and then require a full re-run... when this is the usually the fastest failure point
- DEVELOPMENT.md - src/api/customProperties.ts - src/commands/diff/index.ts - src/flags/var-alias/index.ts - src/utils/FileFilters.ts - src/utils/diff/diff.ts
- Add name to CI formatting step for better readability - Use specific glob patterns for prettier to improve performance - Move prettier check to pretest to fail fast before running tests
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.
Pull Request Overview
This PR integrates Prettier formatting checks into the CI pipeline and developer workflows.
- Adds
formatandformat:checkscripts topackage.json - Hooks
yarn format:checkinto the CI tests andpretestscript - Ensures consistent code formatting across the codebase
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/diff/diff.ts | Reformatted executeDiff signature onto one line |
| src/utils/FileFilters.ts | Switched to single quotes in type references and added comma |
| src/commands/diff/index.ts | Broke long return expression into multiline for clarity |
| src/api/customProperties.ts | Expanded function parameters onto separate lines |
| package.json | Added Prettier scripts (format, format:check, pretest) |
| DEVELOPMENT.md | Inserted blank lines for better section separation |
| .github/workflows/tests.yml | Added “Check formatting” step before running tests in CI |
* Add Prettier formatting checks to CI and package scripts Co-authored-by: jonathan <[email protected]> * Format code with prettier - DEVELOPMENT.md - src/api/customProperties.ts - src/commands/diff/index.ts - src/flags/var-alias/index.ts - src/utils/FileFilters.ts - src/utils/diff/diff.ts * Address PR comments - Add name to CI formatting step for better readability - Use specific glob patterns for prettier to improve performance - Move prettier check to pretest to fail fast before running tests --------- Co-authored-by: Cursor Agent <[email protected]>
This PR adds prettier commands to the package.json and integrates formatting checks into the CI workflow to enforce consistent code formatting.
Changes:
formatandformat:checkscripts to package.jsonyarn format:checkduring the test pipelineposttestscript to include prettier validation alongside existing lintingImpact:
yarn formatto auto-format code locallyThe changes leverage existing prettier configuration (
.prettierrc.jsonand.prettierignore) already present in the repository.