Skip to main content

rumk

Makefiles, built right.

Fast, trustworthy linting and formatting for Makefiles.

CI crates.io PyPI License

[!WARNING] Alpha software under active development. Rumk is useful today, but its rules, CLI, configuration, diagnostics, and autofixes may change between 0.0.x releases. Pin the version in automation and review autofix diffs before committing them.

Rumk is the Makefile sibling of Rumdl.

Its CLI, configuration model, diagnostics, fixing behavior, and exit codes intentionally follow Rumdl so existing users can reuse their workflow.

Features

  • Lints individual Makefiles or entire directory trees
  • Safely fixes recipe indentation, long static and style-aware missing .PHONY declarations, and recursive Make invocations
  • Parses continued logical statements and nested $(...)/${...} expressions
  • Models GNU Make assignment flavors, static patterns, target-specific variables, includes, conditionals, define blocks, custom recipe prefixes, and .ONESHELL
  • Builds semantic indexes for variables, references, targets, dependencies, and includes
  • Safely evaluates statically knowable variables and conditionals without running recipes, shell commands, or side-effecting Make functions
  • Supports GNU substitution references plus common word, path, list, and lazy logical functions
  • Resolves expanded include graphs and reports cross-file findings at their real source paths
  • Preserves LF/CRLF line endings and final newlines during fixes
  • Uses Rumdl-style check, fmt, rule, config, init, and explain commands
  • Discovers .rumk.toml upward through the project tree
  • Respects .gitignore by default
  • Supports rule selection, file globs, per-file ignores, severities, and fix allowlists
  • Emits text, flat JSON, and GitHub Actions annotations

Installation

cargo install rumk --locked --version 0.0.7

Or install the native executable from PyPI with a Python tool manager:

uv tool install rumk==0.0.7
# or
pipx install rumk==0.0.7

Rumk is alpha-stage 0.0.x software, so installation names the version explicitly. Release archives and Python wheels cover Linux, macOS, and Windows. GitHub release assets include SHA-256 checksums.

GitHub Actions

The repository is also a composite Action that installs a checksum-verified native Rumk release, runs it, and leaves rumk on PATH for later steps:

steps:
  - uses: actions/checkout@v4
  - uses: rvben/rumk@v0.0.7
    with:
      version: 0.0.7
      path: .
      report-type: annotations

Pin both the Action ref and version while Rumk is alpha. The moving v0 Action tag is available for users who prefer automatic 0.x Action updates. Supported commands are check, fmt-check, and fmt; install-only: true only installs Rumk. The Action also accepts config, args, fail-on-error, and output-file, and exposes rumk-version and rumk-path outputs.

Quick start

# Check Makefiles below the current directory
rumk check

# Check specific files or directories
rumk check Makefile build/

# Apply safe fixes, then fail only if violations remain
rumk check --fix

# Format files with formatter-style exit behavior
rumk fmt

# Preview formatting changes
rumk fmt --diff

# Fail when formatting changes are required
rumk fmt --check

# Inspect rules and effective configuration
rumk rule
rumk rule MK101
rumk config
rumk config get MK101.line-length
rumk config file

Run rumk --help or rumk <command> --help for all options.

Configuration

Create a .rumk.toml file manually or run rumk init:

[global]
dialect = "gnu"
respect-gitignore = true
exclude = ["vendor/**", "generated/**"]
disable = ["MK101"]
fixable = ["MK001"]
include-paths = ["mk"]
predefined-variables = { FROM_CLI = "yes" }
entry-targets = ["all"]

[MK101]
enabled = true
severity = "warning"
line-length = 100
ignore-comments = true
ignore-recipes = true

[MK102]
enabled = true
style = "upper-case"

[MK201]
placement = "auto"

[per-file-ignores]
"vendor/**/*.mk" = ["MK202"]

For configuration completion and validation in editors that support inline TOML schemas, put this comment at the top of the file:

#:schema https://raw.githubusercontent.com/rvben/rumk/main/rumk.schema.json

The versioned schema is also included in Cargo packages and native release archives.

Configuration discovery checks .rumk.toml, rumk.toml, and .config/rumk.toml while walking upward, stopping at a Git project boundary. Use --config <PATH> for an explicit file or --no-config/--isolated for built-in defaults.

Configurations can inherit another file with extends = "../.rumk.toml"; nested tables are merged, child values win, relative paths resolve from the extending file, and cycles are rejected.

Rules can be suppressed in Make comments without changing project configuration:

# rumk-disable MK202
INSTALL_PREFIX := /usr/local
# rumk-enable MK202

# rumk-disable-next-line MK201
clean:
	rm -rf build

rumk-disable, rumk-enable, rumk-disable-line, and rumk-disable-next-line are supported. Recipe shell comments are not interpreted as Rumk directives.

The original Rumk [rules] and [ignore] configuration sections remain accepted for migration.

include-paths models GNU Make's -I search directories and resolves relative entries from the configuration directory. predefined-variables supplies command-line-style values to safe evaluation and names expected by opt-in rule MK208. That rule intentionally ignores references inside recipes and deferred macro bodies, where command-line parameters and shell values are normal. entry-targets supplies the roots for opt-in reachability rule MK209; the rule stays silent without explicit roots because any Make target may be invoked directly from the command line.

Rule and file selection

Rumk follows Rumdl's selection vocabulary:

rumk check --enable MK001,MK002 .
rumk check --disable MK101 .
rumk check --extend-enable MK202 .
rumk check --exclude "vendor/**,generated/**" .
rumk check --include "src/**" .
rumk check --respect-gitignore=false .
rumk fmt --fixable MK001 .

Exit codes

  • 0: success, or all selected violations were fixed
  • 1: lint violations, or fmt --check found required changes
  • 2: configuration, file access, or other tool error

rumk check fails on any diagnostic by default. Use --fail-on warning, --fail-on error, or --fail-on never to change that policy. rumk fmt exits successfully after formatting even if non-fixable lint diagnostics remain.

Output

Text diagnostics follow Rumdl's familiar form:

Makefile:2:1: [MK001] Recipe must be indented with tab, not spaces [*]

JSON output is a flat array collected across all files:

rumk check --output-format json .
[
  {
    "file": "Makefile",
    "line": 2,
    "column": 1,
    "end_line": 2,
    "end_column": 1,
    "rule": "MK001",
    "message": "Recipe must be indented with tab, not spaces",
    "severity": "error",
    "fixable": true,
    "fix": {
      "range": { "start": 7, "end": 11 },
      "replacement": "\t"
    }
  }
]

The legacy --format spelling remains an alias for --output-format.

Rules

Rules marked default run without configuration. Each rule page documents its behavior, configuration, fixes, edge cases, and the GNU Make, POSIX, or Rumk convention on which it is based.

Syntax

  • MK001 — Recipes must use tab indentation (default, fixable)
  • MK002 — Invalid variable syntax (default)
  • MK003 — Malformed conditional structure (default)
  • MK004 — Targets must not mix single- and double-colon declarations (default)
  • MK005 — GNU Make special targets must stand alone (default)

Style

  • MK101 — Declarative line exceeds the configured maximum length; comments and recipes are ignored by default, and static .PHONY declarations can be wrapped safely (default, partially fixable)
  • MK102 — Variable naming convention
  • MK103 — Target naming convention

Best practices

  • MK201 — Conventional non-file targets should be .PHONY; fixes consolidate canonical groups, preserve per-section style, and wrap long declarations (default, fixable)
  • MK202 — Avoid hardcoded absolute paths (opt-in)
  • MK203 — Recursive Make invocations should use $(MAKE) (default, fixable)
  • MK204 — Concrete targets should not declare multiple single-colon recipes (default)
  • MK205 — Explicit target dependencies must not form cycles (default)
  • MK206 — Required static includes must resolve (default)
  • MK207 — Static Makefile includes must not form cycles (default)
  • MK208 — Static graph-level variable references must resolve (opt-in)
  • MK209 — Targets must be reachable from explicitly configured entries (opt-in)
  • MK210 — Explain include expressions blocked by safe evaluation (opt-in)

Development

cargo test --all-targets --all-features
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --all -- --check
cargo build --release
make check-gnu-fixtures

The product-level compatibility contract is documented in docs/rumdl-compatibility.md.

Contributing

See CONTRIBUTING.md.

License

MIT. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rumk-0.0.7.tar.gz (132.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rumk-0.0.7-py3-none-win_amd64.whl (1.5 MB view details)

Uploaded Python 3Windows x86-64

rumk-0.0.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

rumk-0.0.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

rumk-0.0.7-py3-none-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

rumk-0.0.7-py3-none-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file rumk-0.0.7.tar.gz.

File metadata

  • Download URL: rumk-0.0.7.tar.gz
  • Upload date:
  • Size: 132.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rumk-0.0.7.tar.gz
Algorithm Hash digest
SHA256 521f2aa4b7d5021a3a512f15e6cf4ed3684aa245aee265ac5e8afc7bd03d5962
MD5 8042bb5ce104361f8e31ac87e7da5175
BLAKE2b-256 a76c482494c50996fdbc6d84d37bdb04ebfb69af7e4036fc23cf82767d4b23b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rumk-0.0.7.tar.gz:

Publisher: release.yml on rvben/rumk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rumk-0.0.7-py3-none-win_amd64.whl.

File metadata

  • Download URL: rumk-0.0.7-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rumk-0.0.7-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1926ed91594cd19ce91a9109c831b2159d4314fc655fe3db078280a1d566b434
MD5 32010ced41692885b2f50acb6364c32d
BLAKE2b-256 cc559f43739872bd86b682472efdfc835c928208cb9c0cab948d5163add5c4c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rumk-0.0.7-py3-none-win_amd64.whl:

Publisher: release.yml on rvben/rumk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rumk-0.0.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rumk-0.0.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a51aeb0be25e245c59d080c1b1d8cd43c593416daef366de6ff22339ae60a9f3
MD5 8665a81aca3cb101d28e75016fba6edb
BLAKE2b-256 65c4a57f342585a57061af55b9a0e605567679d8fae3964de93fa360a37e3f21

See more details on using hashes here.

Provenance

The following attestation bundles were made for rumk-0.0.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on rvben/rumk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rumk-0.0.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rumk-0.0.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1949ff4bdbe7f51e00c5385cab112d6620f142c686e00072860a1fa9b8069a9e
MD5 8f1cbfa8edad4a1b790796626f3edf29
BLAKE2b-256 365b3aad0a839ab3fd58166c67e3c3eb96a79dc29378bc723db251a846e231ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for rumk-0.0.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on rvben/rumk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rumk-0.0.7-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: rumk-0.0.7-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rumk-0.0.7-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 92fc5eaee24ef6268eb88daf7dc1aff32b72180a591d67cd3885cb6091c277af
MD5 71c6bbf2904fcade78b4b4e6b013f10f
BLAKE2b-256 0b161d2e359f62f68f056a4ee55bdca5766884b181d52f4f98573769c65799b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for rumk-0.0.7-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on rvben/rumk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rumk-0.0.7-py3-none-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: rumk-0.0.7-py3-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rumk-0.0.7-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 29cc090738c4799a3d2b4a9df62933ac99368115cebc83262c9bbed0237423be
MD5 e2e4f20ac252ba6b0be9a251ea217ac6
BLAKE2b-256 5be88710ba8f83d634a0da3bc4179d55f29f43a617cdb25a80c3d0faac7ab352

See more details on using hashes here.

Provenance

The following attestation bundles were made for rumk-0.0.7-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on rvben/rumk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.0.7 This release

6 files

0.0.6

6 files

0.0.5

6 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page