Hi! Thanks for the tip, Niels!
It would be cool if dh_assistant had some kind of generic command like "dh_assistant validate" which would attempt to introspect all information silently and emit output only if it fails to parse something. Additionally it could emit a non-zero exit code on errors. I tested your latest command and it works as you expected, though it does not use exit code. # dh_assistant detect-unknown-hook-targets The hook target override_dh_car_configure in debian/rules does not seem to match any known commands. # echo $? 0 Also if the JSON included the filename and line number of the finding it would be handy: { "unknown-hook-targets": [ { "candidates": [], "filename": "debian/rules", "target-name": "override_dh_car_configure" } ] } I don't know how much ambition you have for expanding the scope of dh_assistant. We already have Lintian which has a massive amount of checks, including ones related to debian/rules. It is just a pity Lintian does not support checking a single file or the debian/ directory contents without building the package.. [1] [1] https://bugs.debian.org/262783