mrtazz / checkmake

experimental linter/analyzer for Makefiles
MIT License
1.04k stars 45 forks source link

Request: support recursive lookup of checkmake.ini #101

Open Integralist opened 4 months ago

Integralist commented 4 months ago

Expected behaviour

I was hoping the checkmake tool would recursively check for checkmake.ini

e.g. if the current directory (containing a Makefile) has a checkmake.ini then that is used, but if not, move to the parent directory and check for checkmake.ini there, and so on until you reach the user's home directory where most people have configuration files.

Also, the ability to specify a location like ~/.config/checkmate.ini would be cool

Actual behaviour

It only checks the current directory.

Output of checkmake --version

checkmake 0.2.1 built at 2022-10-11T09:52:39Z by Integralist <mark.mcdx@gmail.com> with go version go1.18.5 darwin/arm64

Output of checkmake --debug <your makefile>

N/A

Output of make --version

N/A

Sample Makefile to reproduce issue

N/A

mrtazz commented 4 months ago

Thanks for opening an issue. You can absolutely specify the location of a config file when executing checkmake (see https://github.com/mrtazz/checkmake?tab=readme-ov-file#usage).

For the automatic lookup I'll have to think about it. I've often found it confusing when tools do this because it's a set of implicit assumptions that aren't necessarily clear and make debugging harder. Maybe if there is a way to ask which config file is used that would make it better. I'll think about.

rurban commented 2 months ago

See PR #104 for a ~/checkmake.ini fallback