Skip to content

Add pre-commit.ci config#741

Draft
jaagut wants to merge 2 commits intomainfrom
feature/pre_commit_ci
Draft

Add pre-commit.ci config#741
jaagut wants to merge 2 commits intomainfrom
feature/pre_commit_ci

Conversation

@jaagut
Copy link
Member

@jaagut jaagut commented Jan 27, 2026

Summary

Adds config for enabling https://pre-commit.ci/
This CI or rather GitHub-App runs the pre-commit hooks, pushes automatic fixes and regularly updates to the latest pre-commit hook versions

Proposed changes

Related issues

Checklist

  • Run just build
  • Write documentation
  • Test on your machine
  • Test on the robot
  • Create issues for future work
  • Triage this PR and label it

@github-project-automation github-project-automation bot moved this to 🆕 New in Software Jan 27, 2026
@jaagut jaagut self-assigned this Jan 27, 2026
@jaagut jaagut moved this from 🆕 New to 🏗 In progress in Software Jan 27, 2026
@jaagut jaagut marked this pull request as ready for review January 27, 2026 10:45
@jaagut jaagut moved this from 🏗 In progress to 👀 In review in Software Jan 27, 2026
@jaagut jaagut requested review from ChlukasX and Flova January 27, 2026 10:45
@jaagut
Copy link
Member Author

jaagut commented Jan 27, 2026

Should be merged after #739

@Flova
Copy link
Member

Flova commented Jan 28, 2026

So this is like a dependabot for pre commit?

@jaagut jaagut marked this pull request as draft January 28, 2026 09:30
@jaagut
Copy link
Member Author

jaagut commented Jan 29, 2026

pre-commit CI is now disabled. I will enable it again, once this PR is merged and it does not fail anymore.

@jaagut
Copy link
Member Author

jaagut commented Jan 29, 2026

So this is like a dependabot for pre commit?

Yes, it updates the pre-commit hooks like dependabot updates the GitHub Action versions.

But crucially, it also runs the the pre-commit hooks in a CI, similar to .github/workflows/pre-commit.yml AND it automatically pushes auto-fixing commits. So no need to manually update the branch after locally running pixi run format.

They (https://pre-commit.ci/) claim it is faster than most CIs including GitHub Actions for this task due to targeted caching.

@jaagut jaagut requested a review from texhnolyze January 29, 2026 20:06
@jaagut
Copy link
Member Author

jaagut commented Jan 29, 2026

Unfortunately, it seems like pre-commit.ci does not support cppcheck.
We are currently using https://github.com/pocc/pre-commit-hooks (no updates in 5 years) for clang-format and cppcheck.

For using clang-format, there is a different "officially" supported hook: https://github.com/pre-commit/mirrors-clang-format

This leaves us with four options:

  • Use our GitHub action as before, gain no autofixes and updates
  • Use a hybrid of two pre-commit-config files, one running in pre-commit.ci with the above mentioned pros and an additional GitHub action only running the cppcheck hook.
  • Use https://pre-commit.ci/lite.html as a GitHub action and install and run cppcheck. By this, we gain autofix commits, but don't get automatic hook version updates.
  • Use https://pre-commit.ci/ with all its benefits, but lose on cppcheck.

What do you think?

@jaagut
Copy link
Member Author

jaagut commented Mar 9, 2026

@Flova @texhnolyze @ChlukasX What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

2 participants