A Python-based Makefile formatter and linter
Maintained. Last release 5 weeks ago, commits in 5 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install mbakeREADME as published on PyPI with version 1.5.0.
🍞 mbake
Features
- Smart formatting: Tabs for recipes, consistent spacing, line continuation cleanup
- Intelligent .PHONY detection: Automatically identifies and manages phony targets
- Syntax validation: Ensures Makefiles are valid before and after formatting
- Configurable rules: Customize behavior via a project
.bake.tomlor{XDG_CONFIG_HOME}/bake.toml - CI/CD ready: Check mode for automated formatting validation
- VSCode extension: Full editor integration available
Installation
# Install from PyPI
pip install mbake
# Or install VSCode extension
# Search for "mbake Makefile Formatter" in VSCode Extensions
Quick Start
# Format a Makefile
mbake format Makefile
# Check if formatting is needed (CI/CD mode)
mbake format --check Makefile
# Validate Makefile syntax
mbake validate Makefile
# Initialize configuration
mbake init