kk17 / checkmake

experimental linter/analyzer for Makefiles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

checkmake

Build Status Coverage Status Code Climate Packagecloud MIT license

Overview

checkmake is an experimental tool for linting and checking Makefiles. It may not do what you want it to.

Usage

% checkmake Makefile

% checkmake --help
checkmake.

Usage:
checkmake [--debug|--config=<configPath>] <makefile>
checkmake -h | --help
checkmake --version

Options:
-h --help               Show this screen.
--version               Show version.
--debug                 Enable debug mode
--config=<configPath>   Configuration file to read
--list-rules            List registered rules

% checkmake fixtures/missing_phony.make

      RULE                 DESCRIPTION             LINE NUMBER

  minphony        Missing required phony target    0
                  "all"
  minphony        Missing required phony target    0
                  "test"
  phonydeclared   Target "all" should be           18
                  declared PHONY.

Docker usage

Build the image, or pull it:

docker build . -t checker

Then run it with your Makefile attached, below is an example of it assuming the Makefile is in your current working directory:

docker run -v $(pwd)/Makefile:/Makefile checker

Installation

Requirements

The pandoc document converter utility is required to run checkmate. You can find out if you have it via which pandoc. Install pandoc if the command was not found.

Packages

There are packages for linux up on packagecloud.io or build it yourself with the steps below.

Build

To build checkmake you will need to have golang installed. Once you have Go installed, you can simply clone the repo and build the binary and man page yourself with the following commands.

go get github.com/mrtazz/checkmake
cd $GOPATH/src/github.com/mrtazz/checkmake
make

Inspiration

This is totally inspired by an idea by Dan Buch.

About

experimental linter/analyzer for Makefiles

License:MIT License


Languages

Language:Go 88.5%Language:Makefile 10.9%Language:Dockerfile 0.6%