Releases: carthage-software/mago
Mago 0.19.5
Mago 0.19.5 🛠️
Bug Fixes & Improvements:
- Improved Array Formatting with Comments: Enhanced array formatting to automatically break arrays into multiple lines when comments are present between elements. This significantly improves readability, especially in complex array definitions.
Full Changelog: 0.19.4...0.19.5
Mago 0.19.4
Mago 0.19.4 🛠️
Bug Fixes & Improvements:
This patch release addresses several formatting bugs and improves the overall formatting logic.
- Statement Termination Logic: Corrected the logic for determining if a statement terminates scripting, particularly for
Declare
,For
,Foreach
,While
, and If statements with colon-delimited bodies. Also,HaltCompiler
is now correctly handled. - Assignment Formatting: Improved the logic for breaking after assignment operators, preventing unnecessary breaks in certain cases.
- Class-like Body Formatting: Refactored class-like body formatting to improve spacing and handle empty lines correctly between members.
- Terminator Formatting: Adjusted the formatting of
ClosingTag
terminators to add a space before the tag. - Statement Spacing: Enhanced the logic for adding spaces and newlines between statements, especially for
OpeningTag
statements. - Printer Logic: Corrected the handling of
LineSuffixBoundary
in the printer, ensuring correct spacing and line breaks. - HTML Template Formatting: Fixed an issue with comment placement in HTML templates, ensuring comments are correctly placed after PHP tags.
These changes address and close the following issues: #150, #138, #149, #151.
Mago 0.19.3
Mago 0.19.3 🛠️
Bug Fixes:
- Removed accidental debug println statement left in v0.19.2.
Full Changelog: 0.19.2...0.19.3
Mago 0.19.2
Mago 0.19.2 🛠️
### Bug Fixes & Improvements:
This patch release addresses specific formatting inconsistencies, enhancing both the accuracy and readability of the output.
- Corrected Trailing Comment Placement: Resolved an issue where trailing comments following function calls within return statements were incorrectly positioned before the semicolon. They now correctly appear after the semicolon, adhering to standard syntax. #144
- Enhanced Dangling Block Comment Spacing: Improved the visual separation of dangling comments within non-empty code blocks. A newline is now automatically inserted before these comments, providing necessary spacing and improving code clarity. #143
Full Changelog: 0.19.1...0.19.2
Mago 0.19.1
Mago 0.19.1 🛠️
Bug Fixes & Improvements:
This patch release addresses several formatting issues reported by our community, focusing on improving the accuracy and consistency of our formatter.
- Assignment & Comment Placement: Resolved bugs related to incorrect comment placement within array-like structures, blocks, match expressions, and other constructs, as well as improved handling of assignment operations.
- Member Access Chains: Enhanced the formatting of member access chains, ensuring that newlines within the chain are preserved when the
preserve_breaking_member_access_chain
setting is enabled. Also corrected formatting of method calls and call arguments within these chains.
These fixes address and close the following bug reports: #134, #136, #137.
A big thank you to @innocenzi for reporting these issues and helping us improve the formatter! Your feedback is invaluable.
Full Changelog: 0.19.0...0.19.1
Mago 0.19.0
Mago 0.19.0 🪄
This release delivers a mix of exciting new features and crucial bug fixes, ensuring a more robust and flexible formatting experience.
✨ New Features
- Preserve Line Breaks in Conditional Expressions 🧱 (#132):
- Introducing the
preserve_breaking_conditional_expression
option! - Now you can control line breaks in ternary expressions, maintaining your preferred formatting, even for complex conditionals.
- Introducing the
🛠️ Bug Fixes
- Multiple Formatting Bugs Addressed 🐛:
- We've squashed numerous formatting bugs, improving accuracy and reliability across the board.
- Comprehensive regression tests have been added to ensure these fixes stick!
- Argument Printing and Member Access Chain Logic Fixed (#131):
- Corrected issues with argument printing and member access chains, ensuring consistent and correct formatting.
- Asymmetric Visibility Modifier Reflection Fixed 🛠️:
- Resolved a reflection issue related to asymmetric visibility modifiers, ensuring accurate reflection.
We hope you enjoy the improvements!
Full Changelog: 0.18.1...0.19.0
Mago 0.18.1
Mago 0.18.1 🛠️
This is a patch release to address a critical build issue in 0.18.0
.
🐛 Bug Fixes
- Fixed x86_64-unknown-linux-gnu Build Issue:
0.18.0
was missing the build artifact forx86_64-unknown-linux-gnu
due to a CI workflow error. This release corrects the workflow and provides the missing build.
📝 Note
- No code changes were introduced between
0.18.0
and0.18.1
. This release solely addresses the build issue.
Full Changelog: 0.18.0...0.18.1
Mago 0.18.0
Mago 0.18.0 🪄
This release brings a plethora of improvements to both the formatter and linter, focusing on enhanced readability, flexibility, and robustness.
🚀 Formatter Enhancements
- Tabular Array Formatting with Alignment 📊 (#127):
- Expanded support for expressions within Tabular arrays, now including function calls, static method calls, and class constant access.
- Fixed a critical width calculation issue for the Arabic word "الله", ensuring correct alignment.
- Relaxed row size consistency requirements, allowing for tabular formatting even with minor inconsistencies.
- Consistent Property Hook Formatting 🎣 (#126):
- Property hooks (getters and setters) are now consistently broken into multiple lines, irrespective of
print_width
, enhancing readability. - The only exception is empty hook lists (
{}
), which remain on a single line.
- Property hooks (getters and setters) are now consistently broken into multiple lines, irrespective of
- Preserve Line Break Options 🧱 (#125):
- Introduced five new configuration options to give you fine-grained control over line breaks:
preserve_breaking_member_access_chain
preserve_breaking_argument_list
preserve_breaking_array_like
preserve_breaking_parameter_list
preserve_breaking_attribute_list
- These options allow you to maintain your preferred code structure.
- Introduced five new configuration options to give you fine-grained control over line breaks:
- Parentheses for Literal Numbers in Concatenation 🔢:
- Added parentheses around literal integers and floats within concatenation binary operations for improved clarity.
🛡️ Linter Improvements
- New PSL Plugin 🧩 (#121):
- Introduced a new linter plugin dedicated to Psl (PHP Standard Library) checks, boosting code quality.
🛠️ CLI Improvements
- Enhanced
composer.json
Config Generation 📦:- In the
mago init
command, when generating configuration fromcomposer.json
, non-existent autoload paths are now automatically removed. - Redundant subpaths are also removed, leading to a much cleaner configuration.
- In the
- Config Parsing During Self-Update 🔄:
- Fixed an issue where configuration parsing was incorrectly triggered during the
self-update
command.
- Fixed an issue where configuration parsing was incorrectly triggered during the
- Simplified Formatter Configuration ⚙️:
- Simplified the internal formatter configuration for better maintainability.
🤝 Community Contributions
A huge thank you to @bendavies and @innocenzi for their invaluable contributions! Your bug reports, suggestions, and feedback have been instrumental in improving Mago. Community feedback is what keeps Mago improving!
🧹 Other Changes
- Various chore and maintenance updates to keep things running smoothly.
Full Changelog: 0.17.0...0.18.0
Mago 0.17.0
Mago 0.17.0 🪄
This release of Mago brings new linting rules for Laravel, more formatter options, and bug fixes!
Laravel Linting 🔎
- New Laravel rules: We've added three new linting rules to the Laravel plugin, helping you write cleaner and more idiomatic Laravel code (by @azjezz in #116):
- **
laravel/anonymous-migration
: Encourages the use of anonymous classes for migrations. - **
laravel/middleware-in-routes
: Enforces applying middleware in routes files instead of controllers. - **
laravel/view-array-parameter
: Promotes passing data to views using the array parameter in theview()
function.
- **
Formatter Enhancements 🛠️
- More control over formatting: Four new formatter options give you finer control over how your code is styled (by @azjezz in #114):
- **
array_table_style_alignment
: Enables or disables table-style alignment for arrays. - **
always_break_named_arguments_list
: Controls whether to always break named argument lists into multiple lines. - **
always_break_attribute_named_argument_lists
: Controls whether to always break named argument lists in attributes into multiple lines. - **
parentheses_in_attribute
: Controls whether to include parentheses in attributes when they contain no arguments.
- **
Bug Fixes 🐛
- Member access chain comments: Fixed a bug where comments in member access chains were printed after the access operator instead of before. (by @azjezz in #113)
- Match expression formatting: Fixed a bug that caused incorrect formatting of the
default
arm inmatch
expressions. (by @azjezz in #112) - Binary expression indentation: Fixed a bug that caused incorrect indentation of multi-line binary expressions within parentheses. (by @azjezz in #111)
- Arrow function formatting: Improved the formatting of arrow functions, including better handling of parentheses and argument list breaking. (by @azjezz in #109)
This release includes valuable additions and improvements for both the linter and formatter, making Mago an even more powerful tool for analyzing and styling your PHP code. Enjoy! 🎉
Full Changelog: 0.16.0...0.17.0
Mago 0.16.0
Mago 0.16.0 🪄
This release of Mago focuses on refining the formatter and removing unused configuration options.
Formatter Improvements
- Removed
keyword_case
option: Keywords will now always be formatted in lowercase, adhering to standard conventions and simplifying the configuration. (by @azjezz in #108) - Removed
blank_line_after_open_tag
option: The formatter now intelligently determines when to add newlines after opening tags, eliminating the need for manual configuration. (by @azjezz in afa1b33) - Added
space_after_not_operator
option: This option allows you to add a space between the!
operator and the following expression (e.g.,! $foo
) for improved readability. (by @azjezz in #101)
Other Changes
- Fixed various formatting issues to ensure consistent and correct output for different code structures. (by @azjezz in #102, #103, #104, #105, #106, #107)
This release streamlines the formatter and improves its accuracy.
A big thank you to @innocenzi for all the suggestions and bug reports in #100 and #99 that helped make this release possible! 🙏
Enjoy! 🎉
Full Changelog: 0.15.0...0.16.0