Add workflow to autoupdate pre-commit#191
Conversation
|
I'm not sure what the issue with the Cookiecutter Test is? I can't quite make sense of the error message 😟 |
|
maybe @ednolan has thoughts on this? |
|
Thanks for this commit. The cookiecutter CI failure is caused by a conflict between the syntax for cookiecutter's templates and the syntax for variable substitution in GitHub workflows. You can address it by wrapping the |
|
Thanks for the help, I've made the required changes. |
|
I see problems with cuckiecutter after autoupdate. and update is sometime downgrade? bash-5.2$ git commit -a -m 'sync the cookiecutter with newline too'
trim trailing whitespace.............................(no files to check)Skipped
fix end of files.....................................(no files to check)Skipped
check yaml...........................................(no files to check)Skipped
check for added large files..........................(no files to check)Skipped
clang-format.........................................(no files to check)Skipped
CMake linting........................................(no files to check)Skipped
codespell............................................(no files to check)Skipped
[feature/test-installed-package 272f56f] sync the cookiecutter with newline too
1 file changed, 1 insertion(+), 1 deletion(-)
bash-5.2$ git push
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 12 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 391 bytes | 391.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
To github.com:ClausKlein/exemplar.git
4d70f99..272f56f feature/test-installed-package -> feature/test-installed-package
bash-5.2$ pre-commit autoupdate
[https://github.com/pre-commit/pre-commit-hooks] already up to date!
[https://github.com/pre-commit/mirrors-clang-format] updating v18.1.8 -> v20.1.7
[https://github.com/BlankSpruce/gersemi] updating 0.20.0 -> 0.19.3 # <<<<<<<<<<<<<
[https://github.com/codespell-project/codespell] updating v2.3.0 -> v2.4.1
bash-5.2$ |
I'm not enough of a Git wizard to be able to conclusively demonstrate what's happening and why it's happening, but the GitHub release page indeed shows 0.20.0 as a release but running |
perhaps GitHub needs more time, we should wait a week ;-) |
|
A week has passed, and this is what I see right now: (The other hooks are up-to-date because I ran the command once to see if I could reproduce the erroneous behavior, last week.) @ClausKlein could you also run |
|
|
|
There are two PR approvals here. Is this ready to be merged? |
|
There are no objections to merging the PR from my side. |
Let's merge it! |
|
The only point / question I have is:
bash-5.2$ pre-commit autoupdate
[https://github.com/pre-commit/pre-commit-hooks] already up to date!
[https://github.com/pre-commit/mirrors-clang-format] updating v20.1.7 -> v20.1.8
[https://github.com/BlankSpruce/gersemi] updating 0.15.1 -> 0.21.0
[https://github.com/codespell-project/codespell] updating v2.3.0 -> v2.4.1
bash-5.2$ pre-commit run --all
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-clang-format.
[INFO] Initializing environment for https://github.com/BlankSpruce/gersemi.
[INFO] Installing environment for https://github.com/pre-commit/mirrors-clang-format.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/BlankSpruce/gersemi.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check for added large files..............................................Passed
clang-format.............................................................Passed
CMake linting............................................................Failed
- hook id: gersemi
- files were modified by this hook
codespell................................................................Passed
bash-5.2$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: .pre-commit-config.yaml
modified: src/beman/exemplar/CMakeLists.txt
bash-5.2$ |
|
@ClausKlein I don't think that issue relates to cookiecutter, just pre-commit. But it looks like it could have caused a legitimate problem, which I addressed in |
|
It sounds to me that @ClausKlein has brought up a good point, and it's not immediately obvious to me what changes in Namely, the updates to the version numbers inside the repo's |
|
Oh, good point, I didn't put that together. I'll have to think about how to fix that. In the meantime we can manually patch up the pull requests for exemplar, and it won't be an issue for other repositories because they don't use cookiecutter. |

Description
Added a GitHub Actions workflow to auto-update pre-commit.
I'm not sure what frequency we want to run it at. Running it daily felt excessive; right now it's set to run weekly.
Related Issues
Addresses #164.
Pinging @wusatosi as the creator of that issue and because it has the "mentoring available" tag.
Meta