Disclosure: I leveraged AI assistance to craft the suggestion because I have some challenges in phrasing my ideas clearly (and I am not a native speaker).
Problem
The existing pre-commit like solution overcommit is tightly coupled to ruby and hasn’t support for other, in zammad used languages like go or shell.
Existing solutions
pre-commit
The standard solution is pre-commit. But is maintained by one person and requires python, so this project isn’t a solution.
prek
Someone having differences with the pre-commit maintainer created a compatible re-implementation in rust.
This works so well, that I switched to it (even I program mainly python) and is my recommendation.
Advantages
prekis self-contained and has a devcontainer integration. It doesn’t require a working ruby environment to work, so it doesn’t break easily when not having a sound ruby setup outside of the devcontainer.- No path manipulation. A second side-effect of having a self-contained executable is, that we doesn’t need to manipulate the
$PATHvariable and doesn’t have so much clutter. Also rbenv leads to a significant performance drop when spawning a cli. prekis language-agnostic. You aren’t tied to ruby. It can test js, go, markdown, … as well. Even unsupported text file formats can be cleaned (trailing newline, whitespaces).- Lower entry-burden by a familiar syntax (
pre-commitstyle and yaml format). pre-commitcompatibility. You can use generic hooks frompre-commit.- Healthier maintenance: Unlike
pre-commit, which is closely tied to a single maintainer,prekhas a bigger contributor base, ensuring sustained development and community support. It achieves an even higher development speed thanovercommit.
(for me the main advantages): no performance drop and not maintaining another language setup; just for having git hooks ;).