Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add option to ignore rules on a line basis #31

Open
fdegier opened this issue Jan 16, 2020 · 1 comment
Open

Feature request: add option to ignore rules on a line basis #31

fdegier opened this issue Jan 16, 2020 · 1 comment

Comments

@fdegier
Copy link
Contributor

fdegier commented Jan 16, 2020

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           
@ssokolow
Copy link

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.

  1. Just doesn't have PHONY construct because, being developed for adding build automation to a language which tracks rebuilds already (Rust), all tasks are have PHONY behaviour and there's no other option.
  2. I get spurious minphony failures because test +args="": and clean +args="": don't match test: and clean:. (And a legitimate but unwanted complaint about a missing all because, if just is already breaking from make to fix warts, I might as well fix something I don't like... that name.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants