Mago 0.2.0 is a feature-packed release that brings new capabilities to the linter and formatter, along with a critical bug fix to improve configuration handling. Here’s what’s new:
🆕 New Features
Linter Enhancements
- List Configured Rules:
- Added the
mago lint --list-rules
flag to display all currently configured linting rules, including their levels and options.
- Added the
- Explain Specific Rules:
- Introduced the
mago lint --explain plugin/rule
flag to show detailed documentation, examples, and usage tips for a specific linting rule. This makes understanding and customizing your linter much easier.
- Introduced the
Formatter Improvements
- Target Specific Files or Directories:
- The
fmt
command now supports a[PATH]
argument:mago fmt [PATH]...
. - Specify files or directories to format, bypassing the source configuration. This allows for greater flexibility, such as integrating Mago into your favorite editor (e.g., Zed or VS Code) as a file formatter. 🎉
- The
🛠 Bug Fixes
Configuration File Handling
- Fixed an issue where running Mago from the current working directory (
./mago
) would cause the configuration file to be ignored.- Previously, Mago mistakenly attempted to read the configuration from a file named
mago
(itself), failing due to the file not being a valid TOML file. - Now, Mago directly looks for
mago.toml
and skips attempting to load configuration from a file namedmago
without an extension. This ensures the correct configuration is loaded every time.
- Previously, Mago mistakenly attempted to read the configuration from a file named