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
check indentation of changes on GitHub #308
Conversation
Worked locally, but the action failed with Run git reset --soft HEAD~ && ./scripts/hooks/pre-commit
fatal: ambiguous argument 'HEAD~': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]' |
This only checks the last commit, right? So if you push multiple commits, then it won't check for misindentations introduced by earlier commits that this workflow didn't run for. |
Ah, yes, good point. |
Ok, no, that's empty: |
Ok, Setup OCaml + ocp-indent still takes 1m21s + 30s. |
With |
ubuntu-latest is 20.04 LTS which has ocp-indent 1.7.0 instead of 1.8.1 from opam.
Ok, with At least this detour was helpful for some opam cache experiments for #296. This is now fast enough (5s for installing ocp-indent), but maybe helpful for something else: |
In the run https://github.com/goblint/analyzer/runs/3199968802, we have the error message
|
This reverts commit df2d401. #308 (comment): In the run https://github.com/goblint/analyzer/runs/3199968802, we have the error message ``` ocp-indent file: src/analyses/arinc.ml, lines: 122 ocp-indent: internal error, uncaught exception: Failure("Config file not found - neither /etc/ocamlfind.conf nor the directory /etc/ocamlfind.conf.d") ```
So the apt package is broken? What does it need |
It's still somehow broken, cannot find |
I added a I can't resurrect this PR anymore? I committed it on its branch, but it's not showing those commits anymore after the merge... |
https://github.com/goblint/analyzer/pull/310/checks?check_run_id=3212969178 fails with
|
Strange that it's all 0. |
Yes, I renamed the branch, but that was entirely local before it was published to GitHub. I'm not sure if this is visible to GitHub even, one would think the name of the local branch should not matter... |
If the branch was new on GitHub, then there was no most recent commit on it (the This is probably more work but there's also this:
|
Just confirmed on https://github.com/goblint/analyzer/runs/3230967934 that the first push on a new branch has all 0. |
0ce4a7d#diff-6491407272b29329ba5425cc471e9018652b90c17e6581dd1c0769eeb8a7f56dR16
Did you try |
I suppose so. I just wanted those zero commit failures to go away because they made the indentation workflow too easy to ignore for false alarms.
That's not fully accurate either because you might push multiple commits to a new branch, but this would only consider the last of those. |
Stumbled upon this: https://pre-commit.ci
Not sure if we want automatic commits that fix indentation in PRs.
Also, https://pre-commit.com does not list OCaml, so we might as well just add another GitHub workflow for it.
Originally posted by @vogler in #236 (comment)
Setting up OCaml just to install
ocp-indent
to check the code seems like a lot overhead, but maybe this can be cached.