Skip to content

Mago 0.13.0

Compare
Choose a tag to compare
@github-actions github-actions released this 27 Feb 04:44
· 65 commits to main since this release
17f2cad

This release of Mago focuses on enhancing the formatter, improving the linter, and refining the CLI.

Formatter Enhancements 🛠️

  • Fluent member access chains: The formatter now supports fluent member access chains, allowing for more concise and readable formatting of alternating property access and method calls. (by @azjezz in #90)
  • Expanded member access chain handling: The formatter now handles both property accesses and method calls in member access chains, providing more consistent and comprehensive formatting. (by @azjezz in #91)
  • Hugging single instantiation arguments: The formatter now "hugs" single instantiation arguments in function calls, resulting in more compact and readable code. (by @azjezz in #92)
  • Expanding last instantiation argument: The formatter now expands the last instantiation argument in a function call if it has multiple named arguments, improving readability for complex expressions. (by @azjezz in #93)
  • Enhanced member access chain printing conditions: Refined the conditions for printing member access chains to improve formatting consistency. (by @azjezz in ff86425)
  • Removed method_chain_break_threshold option: This option is no longer needed due to other improvements in method chain formatting. (by @azjezz in 048fac1)
  • Expanding first argument if it's an array: The formatter now expands the first argument in a function call if it's an array, improving readability for complex expressions. (by @azjezz in 1718a97)

Linter Improvements 🔍

  • New strictness rules: Added new rules to the strictness plugin to help prevent loose comparison and type juggling issues, promoting stricter and more predictable code. (by @vvvinceocam in #84)
  • Panic on parse errors in tests: Improved the linter's test suite by panicking when a test case contains a parse error, ensuring that test cases are valid. (by @azjezz in cc3dca5)

CLI Refinements 🖥️

  • Deprecated fix command: The fix command has been deprecated in favor of lint --fix, simplifying the CLI and reducing redundancy. (by @azjezz in 10d2abb)

Other Changes

  • Fixed parsing assignment expressions: Resolved an issue with parsing assignment expressions nested within binary expressions. (by @azjezz in 8a94457)
  • Fixed formatting binaryish expressions: Improved the formatting of binary expressions to handle certain edge cases correctly. (by @azjezz in 6ccd95d)
  • Fixed printing while loop condition: Corrected the printing of while loop conditions to ensure accurate formatting. (by @azjezz in b3143d4)
  • Fixed inlining parameter attributes: Resolved an issue with inlining parameter attributes in function definitions. (by @azjezz in d48547a)
  • Allowed mixed numeric-lowercase chars in class-name prefixes: Updated casing rules to allow mixed numeric and lowercase characters as part of a class name prefix. (by @azjezz in b8ebdbc)

This release includes a wide range of improvements and bug fixes for both the formatter and linter, making Mago an even more powerful tool for PHP code styling and analysis. Enjoy! 🎉


Full Changelog: 0.12.0...0.13.0