feat: Add format check to validate script#146
feat: Add format check to validate script#146MichaelDeBoey wants to merge 1 commit intokentcdodds:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #146 +/- ##
=======================================
Coverage 86.86% 86.86%
=======================================
Files 18 18
Lines 335 335
Branches 80 80
=======================================
Hits 291 291
Misses 36 36
Partials 8 8
Continue to review full report at Codecov.
|
| build: ifScript('build', 'npm run build --silent'), | ||
| format: preCommit | ||
| ? null | ||
| : ifScript('format', 'npm run format -- --check'), |
There was a problem hiding this comment.
What happens when prettier is passed --write and --check at the same time?
Also, this kinda assumes that the format script is using something that accepts the --check flag (like kcd-scripts format which forwards the flags to prettier). So it probably does, but maybe we should note that in a code comment.
There was a problem hiding this comment.
The test one also assumes there's a test script that accepts a --coverage flag, so I don't think we should mind the --check flag
Have to look into the code so we don't send the --write flag when checking I think.
nickserv
left a comment
There was a problem hiding this comment.
Haven't tested this but the code looks good
|
Actually just noticed something. Is the script passed file paths to format? If not Prettier will fail and print usage, so you should add |
Closes #64
Closes #65