SublimeLinter-contrib-makefile
SublimeLinter plugin for Makefiles
Details
Installs
- Total 256
- Win 115
- Mac 64
- Linux 77
May 9 | May 8 | May 7 | May 6 | May 5 | May 4 | May 3 | May 2 | May 1 | Apr 30 | Apr 29 | Apr 28 | Apr 27 | Apr 26 | Apr 25 | Apr 24 | Apr 23 | Apr 22 | Apr 21 | Apr 20 | Apr 19 | Apr 18 | Apr 17 | Apr 16 | Apr 15 | Apr 14 | Apr 13 | Apr 12 | Apr 11 | Apr 10 | Apr 9 | Apr 8 | Apr 7 | Apr 6 | Apr 5 | Apr 4 | Apr 3 | Apr 2 | Apr 1 | Mar 31 | Mar 30 | Mar 29 | Mar 28 | Mar 27 | Mar 26 | Mar 25 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
About
A plugin for SublimeLinter which provides linting for Makefiles.
Installation
Use Package Control: search for a
package named SublimeLinter-contrib-makefile
and install it.
SublimeLinter must also be installed.
Checkers
This plugin is able to detect the following mistakes. They will be visually signaled in the status bar and the left gutter.
Undefined global variable names
Correct:
FOO = 1
test:
echo $(FOO)
Incorrect:
test:
echo $(FOO)
Undefined target names
Correct:
clean:
rm -rf build/*
test:
${MAKE} clean
pytest .
Incorrect:
test:
${MAKE} clean
pytest .
Duplicated targets
When there's 2 targets with the same name, e.g.:
test:
pytest .
test:
pytest .
Use of spaces instead of tabs
Any line starting with a space instead of tab is considered an error, e.g.
test1:
pytest . # use tab
test2:
pytest . # use spaces
Missing .PHONY
directive
This will print missing .PHONY declaration
if there's a file or directory
named “test” in the same directory as the Makefile:
test:
pytest .
Trailing spaces
Any trailing space at the end of the line, e.g.:
test:
pytest .<SPACE><SPACE><SPACE>
Unnecessary empty lines at EOF
E.g.:
test:
pytest .
Motivations
Why not use an existing CLI tool?
As stated in https://github.com/SublimeLinter/package_control_channel/pull/134, the motivation which led me to write this plugin is because the only Makefile linter I found is https://github.com/mrtazz/checkmake, which provides a quite limited set of rules. I wanted a linter which was able to identify at least undefined variable names, undefined target names, and the use of spaces instead of tabs. I found none so I wrote my own.
Why not turn this into a generic CLI tool?
Indeed that probably makes a lot more sense. I may (or may not) do this later. :)