Releases: carthage-software/mago
Mago 0.0.7
Enhancements
- Linter:
- Added PHPUnit plugin: Introduces basic rules for improving PHPUnit usage. Enable it with:
[linter] plugins = ["phpunit"]
- Added PHPUnit plugin: Introduces basic rules for improving PHPUnit usage. Enable it with:
Fixes
-
Formatter:
- Wrap method call chain base in parentheses when needed: Fixes an issue where parentheses were omitted incorrectly in cases like
($foo ?? $bar)->bar()->baz()->qux()->quxx()
, resulting in$foo ?? $bar->bar()->baz()->qux()->quxx()
Reported in #20 by @bendavies. - Default to next line in method chains: Ensures that the first method call in a chain starts on the next line, following PER CS 2.0 standards.
- Add missing parentheses around assignment LHS of array access: Fixes an issue where
$a ?? $b[$foo]
was misinterpreted due to missing parentheses in($a ?? $b)[$foo]
.
Reported in #18 by @bendavies. - Remove leading comma in argument lists: Fixes a bug where arguments like
foo($expr)
were incorrectly formatted asfoo(, $expr)
.
Reported in #19 by @bendavies.
- Wrap method call chain base in parentheses when needed: Fixes an issue where parentheses were omitted incorrectly in cases like
-
Linter:
- Fix the fix plan for
use-while-instead-of-for
: Resolves an issue wherefor (;;)
was incorrectly replaced withfor (; )
instead ofwhile (true)
.
Reported in #21 by @bendavies.
- Fix the fix plan for
Special thanks to @bendavies for testing and reporting several issues!
Full Changelog: 0.0.6...0.0.7
Mago 0.0.6
Enhancements
-
Linter:
- Added
redundant-continue-statement
rule: Detects redundantcontinue
statements in a loop - Added
no-empty-loop
rule: Detects and reports empty loops to improve code quality. - Added
missing-assert-description
rule: Ensuresassert()
statements include descriptions for better debugging context. - Added
loop-does-not-iterate
rule: Highlights loops that do not iterate due to immediate termination.
- Added
-
Miscellaneous:
Fixes
- Linter:
- Formatter:
Full Changelog: 0.0.5...0.0.6
Mago 0.0.5
Enhancements
-
Formatter:
- Implemented
--dry-run
for themago fmt
command - Removed timestamps and target information from logs to declutter output. Note: In debug mode, the target information is still displayed.
- Implemented
-
Linter Fix Command:
- Added messages to inform users when fixes are skipped due to requiring
--unsafe
or--potentially-unsafe
flags. Previously, these fixes were skipped without any user feedback. - Implemented
--dry-run
for themago fix
command. This allows users to preview linting fixes without making any changes to their files.
- Added messages to inform users when fixes are skipped due to requiring
What's Next
We continue to work diligently towards achieving a stable 1.0.0
release. Future updates will include more robust features, enhanced performance, and further refinements based on user feedback.
Feel free to reach out with any feedback or issues you encounter. Your input helps us make Mago better for everyone!
Full Changelog: 0.0.4...0.0.5
Mago 0.0.4
Fixes
Overview
In this release, we've addressed a critical bug in the formatter that affected the parsing of closure creations in PHP code. Specifically, the formatter was removing parentheses around the left-hand side (lhs) of a closure creation node when it was necessary, leading to parse errors.
Bug Details:
Before the fix:
$a = (function(): void {})(...);
After the formatter incorrectly processed it:
$a = function(): void {}(...);
This removal of parentheses caused the PHP parser to throw an error, disrupting the intended functionality.
What’s Fixed:
- The formatter now correctly preserves the parentheses around the lhs of closure creation nodes. This ensures that the following code is formatted correctly and parses without errors:
$a = (function(): void {})(...);
What's Next
We continue working diligently towards achieving a stable 1.0.0 release. Stay tuned for more updates, features, and fixes in upcoming versions!
We have skipped the release version
0.0.3
due to a minor issue.
Mago 0.0.2
Fixes
- Formatter:
What's Next
We are continuously working towards refining Mago and are committed to reaching a stable 1.0.0
release. Stay tuned for more features, improvements, and fixes in upcoming releases!
Feel free to reach out with any feedback or issues you encounter. Your input helps us make Mago better for everyone!
Mago 0.0.1
We are thrilled to share this early snapshot of Mago, a PHP toolchain inspired by the Rust ecosystem’s ergonomics, reliability, and developer experience. However, please note that this is a non-production, pre-1.0.0 release. The tool is still under heavy development, and many features are incomplete or subject to change. We’re working diligently to refine Mago and eventually reach a stable 1.0.0 milestone.
Important Note:
This is a non-production release. Features may be incomplete, change rapidly, or break unexpectedly as we continue to evolve Mago. Your feedback and insights are invaluable during this phase!
New in this Release:
- mago lint: Run our evolving set of linter rules against your PHP project. It’s early days, but we’re adding new rules regularly to help you catch common issues and improve your code quality.
- mago fmt: A fast, smart formatter inspired by Prettier.js. It adheres to PSR-12 standards by default, but also offers various options to customize formatting behavior to your liking.
- mago ast --file path/to/php-file.php: View the Abstract Syntax Tree (AST) for a given PHP file. While primarily an internal debugging tool, it can help advanced users understand how Mago interprets PHP code under the hood.
How to Get Mago:
-
Option 1: Download the Binary: Choose the binary for your platform from the release artifacts below.
-
Option 2: Use Cargo:
cargo install mago
for macOS Users: If you download the binary directly, you’ll need to open System Preferences > Security & Privacy and approve the binary before running it, since it’s not from a recognized developer.
Known Limitations:
- The tool’s behavior and features may change frequently.
- Not all planned features are implemented yet.
- Expect incomplete documentation and limited testing at this stage.
A Glimpse of the Future:
Mago is destined to become a comprehensive toolchain, offering linting, formatting, static analysis, refactoring, and more. We’re working hard toward 1.0.0, where you can expect greater stability, a richer feature set, and a smoother experience.
Your Input Matters:
This project is being developed in public to foster a community-driven process. We invite you to try Mago, share feedback, report bugs, and contribute. Together, we’ll shape Mago into a reliable, production-ready PHP toolchain.
Thank you for joining us early on this journey!