Closed fredrik-bakke closed 1 year ago
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 rzk.yml
file in the root so we can use that instead, @fizruk?
EDIT: I made a pull request: https://github.com/rzk-lang/rzk-action/pull/3 :)
I've updated the title of the PR, since I originally thought this will autoformat Rzk code somehow.
Thanks! I wish...
Thanks! I wish...
I think it should not be too difficult to implement most of the styleguide in a pretty-printer/autoformatter in rzk
itself, and making it available via the VS Code extension. I think even some checks for the naming conventions can be automated. We'll look into that at some point, I think. But probably not in October :)
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 main
branch, i.e. after the PR is merged. It is also configured only to autoformat files touched by the relevant PR.
The workflow only activates on commits to the
main
branch, i.e. after the PR is merged.
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 :)
This is of course assuming the workflow is set up properly.
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.