checkmake
checkmake copied to clipboard
Feature request: add option to ignore rules on a line basis
Most linters have an option to ignore rules in line as in some cases the rules are too strict. E.g. in the Makefile from this repo there is a rule, which IMHO is fine for reading purposes, but it does not follow the rules.
Adding the comment would seem logical to prevent checkmake to complain about rule violation:
# checkmake ignore: maxbodylength
coverage:
@echo "mode: set" > cover.out
@for package in $(PACKAGES); do \
if ls $${package}/*.go &> /dev/null; then \
go test -coverprofile=$${package}/profile.out $${package}; fi; \
if test -f $${package}/profile.out; then \
cat $${package}/profile.out | grep -v "mode: set" >> cover.out; fi; \
done
@-go tool cover -html=cover.out -o cover.html
To prevent this output, which contains a bug as described in #29 :
$ docker run -v $(pwd)/Makefile:/Makefile checker
RULE DESCRIPTION LINE NUMBER
maxbodylength Target body for "coverage" 70
Whether it's on a line-by-line basis or just documenting how to use checkmake.ini to disable rules, this would allow me to use checkmake on justfiles which are syntactically close enough to Makefiles that the main problem is the minphony and phonydeclared checks.
- Just doesn't have
PHONYconstruct because, being developed for adding build automation to a language which tracks rebuilds already (Rust), all tasks are havePHONYbehaviour and there's no other option. - I get spurious
minphonyfailures becausetest +args="":andclean +args="":don't matchtest:andclean:. (And a legitimate but unwanted complaint about a missingallbecause, if just is already breaking from make to fix warts, I might as well fix something I don't like... that name.)