Mago 0.26.1
Hello everyone,
This release introduces a new linter rule for best practices and a powerful new formatting option to improve code organization, alongside several key fixes for the formatter.
⭐ New Features
-
New Linter Rule:
best-practices/no-sprintf-concatenation
: A new rule has been added to discourage string concatenation withsprintf()
calls (e.g.,sprintf(...) . 'string'
). The linter will now suggest incorporating the concatenated parts directly into thesprintf
format string for better performance and readability. (#139) -
New Formatter Option:
separate_class_like_members
: The formatter now inserts a single blank line between different kinds of members inside a class, trait, interface, or enum by default. This visually groups constants, properties, enum cases, trait uses, and methods, making complex class-like structures much easier to read. This behavior can be disabled by settingseparate_class_like_members = false
in yourmago.toml
file. (#223)
🛠️ Fixes & Improvements
- Formatter: Made several improvements to how member access chains (e.g.,
$obj->foo->bar()
) are formatted for better consistency and readability. (#218, #205) - Formatter: Fixed a bug where match expressions used within a string concatenation (.) were not formatted correctly. (#207)
Thank you for your contributions and for helping us improve Mago!
Full Changelog: 0.26.0...0.26.1