Finally, a Makefile formatter (50 years overdue)

https://news.ycombinator.com/rss Hits: 10
Summary

馃崬 mbake A Makefile formatter and linter. It only took 50 years! A Makefile formatter and linter. It only took 50 years! Table of Contents Features Configurable rules via ~/.bake.toml CI/CD integration with check mode Extensible plugin architecture Rich terminal output with progress indicators Syntax validation before and after formatting Smart .PHONY detection with automatic insertion Formatting Rules Indentation & Spacing Tabs for recipes : Recipe lines use tabs instead of spaces : Recipe lines use tabs instead of spaces Assignment operators : Normalized spacing around := , = , += , ?= : Normalized spacing around , , , Target colons : Consistent spacing around target dependency colons : Consistent spacing around target dependency colons Trailing whitespace: Removes unnecessary trailing spaces Line Continuations Backslash normalization : Proper spacing around backslash continuations : Proper spacing around backslash continuations Smart joining: Consolidates simple continuations while preserving complex structures .PHONY Declarations Grouping : Consolidates multiple .PHONY declarations : Consolidates multiple declarations Auto-insertion : Automatically detects and inserts .PHONY declarations when missing (opt-in) : Automatically detects and inserts declarations when missing (opt-in) Dynamic enhancement : Enhances existing .PHONY declarations with additional detected phony targets : Enhances existing declarations with additional detected phony targets Rule-based analysis : Uses command analysis to determine if targets are phony : Uses command analysis to determine if targets are phony Minimal changes: Only modifies .PHONY lines, preserves file structure Installation PyPI (Recommended) pip install mbake VSCode Extension Open VSCode Go to Extensions (Ctrl+Shift+X) Search for "mbake Makefile Formatter" Click Install From Source git clone https://github.com/ebodshojaei/bake.git cd mbake pip install -e . Development Installation git clone https://github.com/ebodshojaei/bak...

First seen: 2025-06-22 07:52

Last seen: 2025-06-22 16:54