Closed MaoShizhong closed 2 months ago
Hmmm, looking into why it can't detect a parser/file given it works in a test repo :thinking:
Turns out ya?ml
wasn't valid in the with.files
bit, so it ran due to the .yml
file but didn't pass it to Prettier :shrug:
@Asartea Could you post a link here to your local repo where you managed to get it working for changed files only with CircleCI?
@Asartea Could you post a link here to your local repo where you managed to get it working for changed files only with CircleCI?
See https://github.com/Asartea/top-odin-bot-v2/tree/test-ci for the code (changes made in package.json
, prettier-ci.sh
, and .circleci/config.yml
)
You can see some example runs (both failing and passing) at https://app.circleci.com/pipelines/github/Asartea/top-odin-bot-v2?branch=test-ci (ignore the ones where I made stupid mistakes)
Thanks. Whoever ends up reviewing this, please let us know whether the GH workflow or CircleCI approach would be preferable. I'm personally not too familiar with CircleCI or bash scripts. If CircleCI would be preferable, then we can close this one superceded by that one.
@KevinMulhern Can I get your input on this mate and whether CircleCI is viable.
Also, shopping for a better name for the package.json script and a better filename for the .sh
file; I'm unconvinced by the current ones
@KevinMulhern Do you think it's worth migrating the current circleci workflows to GH actions? From what I can see it runs (jest and eslint), I believe it shouldn't be too difficult to find the appropriate actions for them.
My two cents is that they should get migrated: its confusing to have workflows split across two different platforms
Yeah I think it'd be worth the it.
I'll open an issue for assignment then :)
Because
Since we have Prettier as a dependency with a
.prettierrc
file andformat
npm script, it'd help to have a pull request workflow that checks all changed files for formatting issues (which can be fixed with a simplenpm run format -- <paths to files>
.Left at a
--check
only workflow so any formatting that may need to be done can go in a separate commit for easier reviewing. If a--write
workflow would be preferable, let me know.If merged, I'll update the repo wiki with formatting instructions.
This PR
Issue
Closes #560
Additional Information
Could not find a way to achieve this via CirclCI - could only find out how to get path filtering to allow an action to run on specific file change (and run
prettier --check .
on everything), rather than an action to only target changed files.Pull Request Requirements
location of change: brief description of change
format, e.g.Callbacks command: Update verbiage
Because
section summarizes the reason for this PRThis PR
section has a bullet point list describing the changes in this PRIssue
section