Unfortunately Checkmake only has 4 rules[0]. It's not a very useful tool unless you're wanting a tool that complains that you don't have an 'all' and 'test' target, or that your target is longer than 5 lines[1].<p>[0]: <a href="https://github.com/mrtazz/checkmake/tree/main/rules" rel="nofollow">https://github.com/mrtazz/checkmake/tree/main/rules</a><p>[1]: <a href="https://github.com/mrtazz/checkmake/blob/main/rules/maxbodylength/maxbodylength.go#L14" rel="nofollow">https://github.com/mrtazz/checkmake/blob/main/rules/maxbodyl...</a>
Cool!<p>I also have an experimental (GNU) makefile auditor called "make-audit", available here: <a href="https://github.com/david-a-wheeler/make-audit" rel="nofollow">https://github.com/david-a-wheeler/make-audit</a><p>Per its README: "It will report when an execution of make reads or changes files in ways that are inconsistent with its Makefile. It requires an "auditor" tool named pmaudit in your PATH. It also requires GNU make to be installed and run as make."<p>Note that these tools are looking for different things and taking different approaches. My make-audit tool is a <i>dynamic</i> analysis tool - you run make and it watches what is done. This "checkmake" tool appears to use static analysis to check against various rules (e.g., there should be an "all"), which is fine but it's a different kind of check.<p>Sadly, my make-audit tool is also rather experimental. As I say in its README, "This is an <i>extremely</i> early version. Much needs fixing." For example:<p>* This doesn't properly handle grouped targets or empty commands. It should handle makefiles with their own SHELL and .ONESHELL values.<p>* I don't think it handles multi-line make commands exactly correctly (it's close but not quite right).<p>* Lots more options are needed.<p>* It needs a better internal test suite.<p>Still, make-audit does do some useful things, and it'd be awesome if others would be willing to work with me to make it reliably useful.
Hmm. `--list-rules` doesn't seem to work (in the docker version anyway), and I threw it at an absolutely awful Makefile (cyclic dependencies, variable spelling errors making them empty, several other clear problems) both before and after I rewrote the whole thing...<p>... and it's only complaining about targets over 5 lines long (really? some of the CLI tools I'm running take 20+ lines of flags spread out for readability, I'm not going to shrink that) and one or two missing .PHONY markers (it's correct about those). There's one fewer missing .PHONY after my rewrite.<p>Given the list in the rules folder, kinda seems like it doesn't check enough to be useful. As much as I would truly love a brutal make checker.
I note the maintainer has asked for help with the project and called for additional maintainers, so if you use this or want it to improve, please get involved:<p><a href="https://github.com/mrtazz/checkmake/issues/44" rel="nofollow">https://github.com/mrtazz/checkmake/issues/44</a>
Nice idea, but...<p>This checks only 4 rules, not even correct.<p>It's also implemented in Go, which is really unsuitable for a program with such a goal.