mrtazz / checkmake

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

Feature: Encourage stricter filename conventions #91

Open mcandre opened 1 year ago

mcandre commented 1 year ago

In order to more quickly distinguish between bmake and gmake files, we could create a new linter rule that warns on ambiguous files.

Basically, Makefile is ambiguous. This can lead to both text editors and humans assuming the wrong syntax. Any Makefile's can be disambiguated by adopting the fully lowercase makefile (bmake) or else GNUmakefile (gmake).

mcandre commented 1 year ago

On second thought, there is value in encouraging the POSIX Makefile name. Projects that do not depend on extensions to the POSIX make standard, should follow the Makefile name.

A rule to the effect of checkbashisms would be helpful. When GNU-isms or BSD-isms are present, recommend the relevant filename. Otherwise, recommend the generic Makefile.

cooljeanius commented 10 months ago

One thing to consider here is how some build systems will automatically generate Makefiles with the Makefile name regardless of what sort of syntax they contain. It isn't really as easy to rename the files in such cases.