Git Product home page Git Product logo

unmake's Introduction

unmake: a makefile linter

                   _
 _ _ ___ _____ ___| |_ ___
| | |   |     | .'| '_| -_|
|___|_|_|_|_|_|__,|_,_|___|

ABOUT

unmake is a makefile linter emphasizing portability. We target the POSIX make standard.

With unmake, you can develop practical, portable makefile scripts, such as for provisioning dev environments.

No need for more heavyweight tools like Ansible, Docker, Lua, Python, or WSL! Just good ol' make.

EXAMPLES

$ cd fixtures/parse-valid

$ unmake .
warning: ./Makefile: MAKEFILE_PRECEDENCE: lowercase Makefile to makefile for launch speed
warning: ./boilerplate-ats.mk:4: SIMPLIFY_AT: replace individual at (@) signs with .SILENT target declaration(s)
warning: ./missing-posix.mk:1: STRICT_POSIX: lead makefiles with the ".POSIX:" compliance marker, or else rename include files to *.include.mk
...

See unmake -h for more options.

See makefile for a live example of a portable dev environment provisioning script for this Rust project.

NOTABLE FEATURES

unmake applies a stricter reading of POSIX syntax than make -n. Whereas make -n may skip inactive sections depending on control flow, unmake scans each line. For example, make -n may only check instructions specific to building the default task.

In fact, the two checks complement each other. make -n checks for dry-run runtime issues. unmake checks for syntactic portability issues.

Directory recursion

unmake automatically recurses over directories.

When recursing over directories, unmake skips symlinks.

unmake skips many implementation-specific files such as GNUmakefile.

unmake skips many machine-generated makefiles. For example, makefiles produced by autotools; Perl; and cmake when using the Unix Makefile generator (both in-source builds and out-of-source builds).

unmake skips any third party makefiles housed in subdirectories like .git, node_modules, or vendor.

To investigate makefiles in more detail, see the --debug or --inspect command line options for unmake.

PARSE ERRORS

unmake can identify low level makefile quirks, such as invalid syntax.

See SYNTAX.md for more information.

WARNINGS

unmake can identify higher level portability recommendations for makefiles.

See WARNINGS.md for more information.

CRATE

https://crates.io/crates/unmake

API DOCUMENTATION

https://docs.rs/unmake/latest/unmake/

DOWNLOAD

https://github.com/mcandre/unmake/releases

INSTALL FROM SOURCE

$ cargo install --force --path .

RUNTIME REQUIREMENTS

(None)

Recommended

CONTRIBUTING

For more details on developing crit itself, see DEVELOPMENT.md.

LICENSE

FreeBSD

MORE EXAMPLES

Some projects using unmake to safeguard their makefiles:

SEE ALSO

  • BSD make, a popular make implementation with BSD extensions
  • cmake, a make-adjacent build system with its own portability features
  • GNU make, a popular make implementation with GNU extensions
  • Grunt, Node.js task runners
  • invoke, a task runner for Python projects
  • lake, a task runner for Lua projects
  • mage, a task runner for Go projects
  • ninja, a fast build system without conditionals
  • nmake, a make-adjacent build system for .NET projects
  • Rake, a task runner for Ruby projects
  • Shake, a task runner for Haskell projects
  • ShellCheck, a linter for POSIX sh family shell scripts
  • slick, a POSIX sh syntax validator
  • tinyrick, a task runner for Rust projects

unmake's People

Contributors

mcandre avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.