Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mago 0.9.1 #207002

Merged
merged 2 commits into from
Feb 8, 2025
Merged

mago 0.9.1 #207002

merged 2 commits into from
Feb 8, 2025

Conversation

BrewTestBot
Copy link
Member

Created by brew bump


Created with brew bump-formula-pr.

release notes
We are excited to announce the release of Mago version 0.9.1, which brings significant improvements and new features to both the formatter and linter. This release focuses on enhancing user control, improving code formatting accuracy, and addressing community feedback.

✨ New Features

🚫 @mago-ignore Comment Support

This release introduces a highly requested feature: the @mago-ignore comment. You can now selectively disable specific linter rules for targeted sections of your code. This provides a flexible way to handle false positives, suppress warnings in specific scenarios, or temporarily bypass certain rules when necessary.

Syntax

  • @mago-ignore {plugin}/{rule} {description}:
    • {plugin}/{rule}: Specifies the linter rule to be ignored (e.g., strictness/require-return-type).
    • {description} (Optional): A brief explanation of why the rule is being ignored. While optional, providing a description is highly recommended for code clarity and maintainability.

Example

/**
 * @mago-ignore strictness/require-return-type
 */
function example()
{
    // @mago-ignore analysis/undefined-function-or-method
    $a = foo();
}

The linter will also intelligently report any @mago-ignore comments that are no longer needed, helping you maintain a clean and relevant set of ignore directives.

This feature was implemented by @azjezz in PR #71, fulfilling a request from @M-arcus in Issue #46.

Ignore comments have been a long-standing community request. This addition empowers users to tailor the linter's strictness to their specific project needs, allowing for more nuanced control over code analysis and improved workflow.

📝 Exclude Files from Formatting

Mago 0.9.1 introduces a new excludes configuration option for the formatter within your mago.toml configuration file. This powerful feature enables you to define patterns for files, directories, or glob patterns that should be excluded from formatting operations.

Example:

[format]
excludes = ["**/src/**/*.generated.php"]

Files matching these patterns will be skipped during formatting, ensuring you can maintain control over specific files that should not be automatically formatted while still benefiting from linting and other analysis functionalities.

This feature was implemented in PR #72 by @azjezz, in response to a request from @bendavies in Issue #28.

This enhancement provides greater flexibility in managing your formatting process, allowing you to selectively format your codebase based on project requirements and preferences.


🛠 Bug Fixes

📝 Fix Trailing & Dangling Comments

This release addresses and resolves several bugs within the formatter specifically related to the handling of trailing and dangling comments. These fixes improve the accuracy and reliability of Mago's code formatting, especially in scenarios with complex comment placements within code blocks and after opening tags.

These important fixes are implemented by @azjezz in PR #73.

This ensures that your code is formatted consistently and predictably, even with intricate comment structures, leading to a more polished and professional codebase.


Happy Formatting & Linting!


Full Changelog: carthage-software/mago@0.9.0...0.9.1

@github-actions github-actions bot added rust Rust use is a significant feature of the PR or issue bump-formula-pr PR was created using `brew bump-formula-pr` labels Feb 8, 2025
Copy link
Contributor

github-actions bot commented Feb 8, 2025

🤖 An automated task has requested bottles to be published to this PR.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Feb 8, 2025
@BrewTestBot BrewTestBot enabled auto-merge February 8, 2025 21:06
@BrewTestBot BrewTestBot added this pull request to the merge queue Feb 8, 2025
Merged via the queue into master with commit 46152aa Feb 8, 2025
15 checks passed
@BrewTestBot BrewTestBot deleted the bump-mago-0.9.1 branch February 8, 2025 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump-formula-pr PR was created using `brew bump-formula-pr` CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. rust Rust use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants