[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Static analyzer / linter for debian/rules?



Hi!

Is anybody aware if there is some kind of static analyzer for the
`debian/rules` file?

I can do very basic syntax checking with `make --dry-run
--makefile=debian/rules` which will error on serious syntax errors
(which I already implemented in my CI workflow[1]).

However, that or a general Makefile tool such as checkmake[2] or
unmake[3] do not help much as the debian/rules is very Debian
specific. Lintian has some checks for debian/rules contents, but it
can't be run on a single debian/rules file or even the debian/
directory directly.[4]

I occasionally come across simple syntax issues which a static
analyzer / linter could easily pick up so I was wondering if it could
be automated. For example in one case[5] exporting
DPKG_GENSYMBOLS_CHECK_LEVEL did not take effect due to easily
detectable incorrect (but not fatal) syntax.

- Otto

[1] https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/b1f1640d414e2c7631cdccbb7f5445a4b8ad56e4
[2] https://github.com/mrtazz/checkmake
[3] https://github.com/mcandre/unmake
[4] https://bugs.debian.org/262783
[5] https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/f2fe8d8300642c373ce325f19d1100d79adeed45


Reply to: