You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use a variety of formatting tools for the code in the phlex repository, which is written in C++, Python, YAML, CMake, Jsonnet, etc. Although there is a comment-based GitHub action that can apply formatting conventions to the pull request, we should consider incorporating https://pre-commit.com into our development workflow.
We've made very positive experiences with pre-commit in SHiP, both for C++ and Python code.
I can prepare a PR with the first few hooks (e.g. clang-format, yaml syntax checking, ruff format, file endings, trailing whitespace) tomorrow.
I also saw that there's a hook for jsonnetfmt, but it seems unmaintained.
Would you also be interested in using the CI service? It's free for public github projects and very convenient.
Agreement at developer retreat: Using pre-commit would benefit our development workflow. Right now, the pre-commit steps should apply formatting changes only (and only for the changed files). Two points:
We do not think using the pre-commit CI is necessary right now.
The pre-commit configuration should stay in sync with other configurations used to achieve similar purposes; ideally, this would be a single point of maintenance within the repository.
Agreement at developer retreat: Using pre-commit would benefit our development workflow. Right now, the pre-commit steps should apply formatting changes only (and only for the changed files).
When installed as a pre-commit hook, the hooks only run over the staged files.
Two points:
We do not think using the pre-commit CI is necessary right now.
OK.
The pre-commit configuration should stay in sync with other configurations used to achieve similar purposes; ideally, this would be a single point of maintenance within the repository.
At least the ruff and clang-format hooks reuse the same configuration as the CI, so no additional maintenance should be needed (apart from potentially updating the version every now and again).
I'll make a small PR to start with ruff format (no check) and clang-format. We can then expand from there.
Activity
olantwin commentedon Mar 5, 2026
We've made very positive experiences with pre-commit in SHiP, both for C++ and Python code.
I can prepare a PR with the first few hooks (e.g. clang-format, yaml syntax checking, ruff format, file endings, trailing whitespace) tomorrow.
I also saw that there's a hook for jsonnetfmt, but it seems unmaintained.
Would you also be interested in using the CI service? It's free for public github projects and very convenient.
knoepfel commentedon Mar 10, 2026
Agreement at developer retreat: Using pre-commit would benefit our development workflow. Right now, the pre-commit steps should apply formatting changes only (and only for the changed files). Two points:
olantwin commentedon Mar 10, 2026
When installed as a pre-commit hook, the hooks only run over the staged files.
OK.
At least the ruff and clang-format hooks reuse the same configuration as the CI, so no additional maintenance should be needed (apart from potentially updating the version every now and again).
I'll make a small PR to start with ruff format (no check) and clang-format. We can then expand from there.