-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add autoformatting to CI (for Markdown, YAML, JSON) #95
Conversation
In the Rzk workflow, we currently explicitly pass the files that are checked: - name: Check all files
uses: rzk-lang/rzk-action@v1
with:
rzk-version: latest
# rzk-version: v0.4.1.1 # example of a specific version
files: src/hott/* src/simplicial-hott/* Has this action been updated to be able to recognize that there is an EDIT: I made a pull request: rzk-lang/rzk-action#3 :) |
I've updated the title of the PR, since I originally thought this will autoformat Rzk code somehow. |
Thanks! I wish... |
I think it should not be too difficult to implement most of the styleguide in a pretty-printer/autoformatter in |
Co-authored-by: Nikolai Kudasov <[email protected]>
I'm not sure how autoformatting after this is merged will affect current PRs. Perhaps, we should merge #93 first, then this. |
There's no rush, but it should minimally affect PRs. The workflow only activates on commits to the |
Isn't it activated on the merge commit that happens when we merge this PR? |
I assume it does, but this PR doesn't touch any of the files that the other PR touches. |
This is of course assuming the workflow is set up properly. |
I don't entirely understand what is going on here so I'll leave it for you to decide :) |
Turns out I didn't 🙃 |
@fredrik-bakke you can create a separate branch and test it out in it. You should have Write access to create new branches in this repo directly, instead of using a fork. |
Ah, thanks! Yep, this wasn't the best approach |
Turns out the workflow needs a github token with write access, but I don't think I have the privilege to generate those |
@fredrik-bakke you should be able to just add something like the following to the job in the workflow file: permissions:
contents: write For example, see https://github.com/rzk-lang/rzk/blob/530666653a308a131da9225f7f9426d1b0a65a3b/.github/workflows/mkdocs.yml#L13-L14 |
Ah, wow, thanks! That seems to have fixed it. I made a new pull request #96. |
If I didn't mess this up, it will autoformat markdown (and json and yaml) files according to our settings in
.prettierrc.json
on commits to the main branch, i.e. when merging pull requests.