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

Empty strings for blank makefile lines in debug logs #84

Open
mcandre opened this issue Mar 21, 2023 · 0 comments
Open

Empty strings for blank makefile lines in debug logs #84

mcandre opened this issue Mar 21, 2023 · 0 comments

Comments

@mcandre
Copy link

mcandre commented Mar 21, 2023

Expected behaviour

Blank makefile lines should be ignored before emitting warnings to logs.

Also, a specific line number would be helpful for identifying any actual problematic makefile lines.

Actual behaviour

$ checkmake --debug Makefile
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Running rule 'maxbodylength'...
2023/03/20 22:05:22 Running rule 'minphony'...
2023/03/20 22:05:22 Running rule 'phonydeclared'...
2023/03/20 22:05:22 Running rule 'timestampexpanded'...
    RULE              DESCRIPTION             LINE NUMBER  
                                                           
  minphony   Missing required phony target    1            
             "test"

Output of checkmake --version

checkmake built at 2022-12-11T14:02:56Z by Homebrew homebrew@brew.sh with go version go1.19.4 darwin/arm64

Output of checkmake --debug <your makefile>

$ checkmake --debug Makefile
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Unable to match line '' to a Rule or Variable
2023/03/20 22:05:22 Running rule 'maxbodylength'...
2023/03/20 22:05:22 Running rule 'minphony'...
2023/03/20 22:05:22 Running rule 'phonydeclared'...
2023/03/20 22:05:22 Running rule 'timestampexpanded'...
    RULE              DESCRIPTION             LINE NUMBER  
                                                           
  minphony   Missing required phony target    1            
             "test"

Output of make --version

GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

Sample Makefile to reproduce issue

.PHONY: all lint clean

all: lint

safety:
	safety check

shfmt:
	stank . | grep -v node_modules | xargs shfmt -w -i 4

bashate:
	stank . | grep -v node_modules | xargs bashate

funk:
	@funk .

shellcheck:
	@stank -exInterp zsh . | grep -v node_modules | xargs shellcheck

yamllint:
	@yamllint -s .yamllint .

checkmake:
	checkmake Makefile

lint: safety shfmt funk shellcheck yamllint checkmake
@mcandre mcandre changed the title Bad line numbers in debug logs Empty strings for lines in debug logs Mar 21, 2023
@mcandre mcandre changed the title Empty strings for lines in debug logs Empty strings for blank makefile lines in debug logs Mar 21, 2023
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

1 participant