Bug Fixes
- Fixed Non-Zero Exit Code for Warnings/Notes:
In version0.6.1
, we fixed the exit code behavior to ensuremago lint
exits with a non-zero code when errors are present. However, this inadvertently caused the command to exit with a non-zero code even when only warnings, notes, or help messages were present. This has now been fixed.
Fix: Replaced the logiclevel <= Level::Error
with the cleanerhas_minimum_level(Level::Error)
method, which correctly checks if any issues meet or exceed the error level.
Impact: The CLI now correctly exits with a non-zero code only when errors are present, allowing warnings, notes, and help messages to pass without failing the linting process.
How to Upgrade
- If you installed Mago using the pre-built binary, the install script, or Homebrew, run:
mago self-update
- If you are using Composer, run:
composer require carthage-software/mago:^0.6.1 --dev
- If you are using Cargo, run:
cargo install mago@0.6.1
Why This Matters
This fix is critical for users relying on mago lint
in automated workflows, such as CI/CD pipelines, where a non-zero exit code is expected when linting errors are found. Without this fix, pipelines could incorrectly proceed despite linting failures, potentially allowing insecure or problematic code to be deployed.
Thank You
We appreciate the community’s support in making Mago better. If you encounter any issues or have suggestions, please open an issue on GitHub.
Happy linting! 🚀