Add linter and guard, apply fixes and suppress by scope#49
Open
WalterWoshid wants to merge 3 commits intoj-plugins:mainfrom
Open
Add linter and guard, apply fixes and suppress by scope#49WalterWoshid wants to merge 3 commits intoj-plugins:mainfrom
WalterWoshid wants to merge 3 commits intoj-plugins:mainfrom
Conversation
Author
|
This Pull Request also makes #47 obsolete, because it is included. |
654e856 to
3a848ce
Compare
xepozz
requested changes
Feb 12, 2026
Contributor
xepozz
left a comment
There was a problem hiding this comment.
Thanks for improving the plugin, but let's make it a bit clear first
src/main/kotlin/com/github/xepozz/mago/qualityTool/MagoMessageProcessor.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/xepozz/mago/qualityTool/MagoMessageProcessor.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/xepozz/mago/qualityTool/MagoMessageProcessor.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/xepozz/mago/qualityTool/MagoMessageProcessor.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/xepozz/mago/qualityTool/MarkIgnoreAction.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/xepozz/mago/qualityTool/MagoApplyEditAction.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/xepozz/mago/intentions/apply/MagoApplyEditAction.kt
Show resolved
Hide resolved
src/main/kotlin/com/github/xepozz/mago/qualityTool/MagoHtmlAnnotator.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/xepozz/mago/qualityTool/MagoHtmlAnnotator.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/xepozz/mago/qualityTool/MagoHtmlAnnotator.kt
Outdated
Show resolved
Hide resolved
Author
|
Thanks for the review, will do that tomorrow :) |
|
@WalterWoshid hey! sorry for bothering, do you still work on this? |
Author
|
Hi @zip-fa, I was still working on this #49 (comment) but got distracted in real life, gonna try to continue with this. I can also push a branch with my current implementation if you need it. |
c00bb18 to
c5e6aec
Compare
- Run mago lint and guard with analyze; merge results into annotations - Apply single fix or apply-all by safety (safe / potentially unsafe / unsafe) - Format after fix: run Mago formatter when the option is enabled in settings - Mago: Suppress for statement, function, method, class (submenu when multiple); always show "for statement" so narrowest scope is available - Intention preview (Ctrl+Q) for apply and suppress
c5e6aec to
86cdbf3
Compare
Author
|
@xepozz I updated the issue description and resolved all your comments! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mago inspection now runs lint and guard together with analyze and shows all results in the editor. You can apply Mago autofixes from annotations and suppress issues by statement, function, method, or class. Fixes and suppress actions support intention preview (Ctrl+Q).
Changes
Linter and guard – When enabled in settings, the pipeline runs

mago lintandmago guardin addition to analyze and merges problems into the same annotations. Lint and guard issues get the same apply-fix and suppress quick fixes as analyze.Better descriptions

Apply fix – Apply a single Mago autofix from the problem annotation (Alt+Enter). Fix text uses issue help or message, prefixed with "Mago: ". Before there was a global "Mago: fix the whole file", which only ran the formatter. This has been removed.

Apply all by safety – Submenus: "Fix all (safe only)", "Fix all (potentially unsafe)", "Fix all (unsafe)". Each applies only that tier; apply-all uses in-memory edits (no CLI run) so undo works.

Mago: Ignore/Expect – Quick fix to add

@mago-ignore/expect category:codewith options: for statement, for function, for method, for class. Submenu when multiple apply. Same-category codes merged into one comment.Ignore/Expect appends correctly to an existing comment

Mago: Navigate to cause - Places the cursor to the problem (works with problems that are reporting in other files!)


\Mago\inspect(...)supportImproved debug notification

Format after fix option - Runs the formatter after applying a fix.

Workspace mappings - Multiple workspace support

Platform – Target PhpStorm (PS) 2025.3.2, adjust Plugin versions + Docker
Required Mago Changes for optimal usage
--stdin-inputSupport - This allows passing the editor file contents to the Mago commands. Why? Because if running it without the option will analyze the unsaved file and the annotations are broken/misplaced. I added fallback without--stdin-inputif Mago is used with an older version, but that can be removed in the future and only display an error.Baseline ignored when using
--workspacefix - When Mago is launched from the plugin (from a remote interpreter) it uses the/working directory and--workspace, but it doesn't correctly resolve the baseline entries. This fixes it.