DEV Community

ameobius
ameobius

Posted on

cfg-guard: A lock and a witness for config files too many hands…

Most cfg-guard write-ups stop at the README: here is what the tool does, here is how you run it. This one covers what it refuses to do, and where it breaks.

What it is

A lock and a witness for config files too many hands edit: flock plus a content-hash compare-and-swap refuse a write whose base bytes moved, and inotify with /proc names whoever writes around the lock. Stdlib only.

In Russian: Замок и свидетель для конфигов, которые правят много рук: flock плюс compare-and-swap по хэшу содержимого не дают затереть чужую правку, а inotify и /proc называют того, кто пишет мимо замка. Только stdlib.

Install

pip install cfg-guard
Enter fullscreen mode Exit fullscreen mode

Python. MIT licensed. Standard library first: the tool reads the data you point it at and sends nothing anywhere.

Where it does not fit

Every rule in a checker like this can produce a false positive. Use it to find candidates for a rewrite, not to grade a writer, and not where the voice is the point.

Repository

Source, issue tracker and documentation: https://gitlab.com/ameobius-ai/cfg-guard

Other tools from the same author: https://ameobius-ai.gitlab.io

Top comments (0)