Auto-detection: Automatically identifies phony targets when .PHONY already exists
Minimal changes: Only modifies .PHONY lines, preserves file structure
Option 1: PyPI (Recommended)
Option 2: VSCode Extension
Open VSCode
Go to Extensions (Ctrl+Shift+X)
Search for "mbake Makefile Formatter"
Click Install
git clone https://github.com/ebodshojaei/mbake.git
cd mbake
pip install -e .
git clone https://github.com/ebodshojaei/mbake.git
cd mbake
pip install -e ".[dev]"
mbake uses a subcommand-based CLI structure. All commands support both bake and mbake aliases.
# Check version
bake --version
# Initialize configuration (optional)
bake init
# Format a Makefile
bake format Makefile
# Validate Makefile syntax
bake validate Makefile
# Initialize configuration file with defaults
bake init
# Initialize with custom path or force overwrite
bake init --config /path/to/config.toml --force
# Show current configuration
bake config
# Show configuration file path
bake config --path
# Use custom configuration file
bake config --config /path/to/config.toml
# Format a single Makefile
bake format Makefile
# Format multiple files
bake format Makefile src/Makefile tests/*.mk
# Check if files need formatting (CI/CD mode)
bake format --check Makefile
# Show diff of changes without modifying files
bake format --diff Makefile
# Format with verbose output
bake format --verbose Makefile
# Create backup before formatting
bake format --backup Makefile
# Validate syntax after formatting
bake format --validate Makefile
# Use custom configuration
bake format --config /path/to/config.toml Makefile
Contributions are welcome! Please read our Contributing Guide for details on:
Code of conduct
Development process
Submitting pull requests
Reporting issues
Quick Start for Contributors
Fork the repository
Create a feature branch (git checkout -b feature/amazing-feature)
Make your changes
Add tests for new functionality
Run the test suite (pytest)
Commit your changes (git commit -m 'Add amazing feature')
Push to the branch (git push origin feature/amazing-feature)
Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
✅ Core formatting engine (100% test coverage)
✅ Configuration system
✅ Command-line interface with subcommands
✅ Plugin architecture
✅ Assignment spacing normalization
✅ Tab indentation handling
✅ Whitespace management
✅ Line continuation formatting
✅ Makefile syntax validation
✅ Shell completion support
✅ CI/CD integration
🚧 Advanced rule customization
🚧 IDE integrations
Minimal changes: Only modify what needs to be fixed, preserve file structure
Predictable behavior: Consistent formatting rules across all Makefiles
Fast execution: Efficient processing of large Makefiles
Reliable validation: Ensure formatted Makefiles have correct syntax
Developer-friendly: Rich CLI with helpful error messages and progress indicators
This approach ensures a reliable, maintainable formatter that handles common Makefile formatting needs while preserving the structure and functionality of your build files.