-
-
Notifications
You must be signed in to change notification settings - Fork 888
feat(biome_service): support applying GritQL plugin rewrites via --write #9073
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
Open
chocky335
wants to merge
32
commits into
biomejs:next
Choose a base branch
from
chocky335:feat/fixable-gritql-plugins
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,823
−113
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
cc75070
feat(biome_grit_patterns): implement rewrite linearization
chocky335 d77242a
feat(biome_analyze): support code actions from analyzer plugins
chocky335 e8f051d
fix(biome_service): prevent infinite loop when applying empty mutations
chocky335 5319ad2
feat(biome_service): apply plugin rewrite text edits via --write
chocky335 27c1043
chore: add changeset for fixable GritQL plugins
chocky335 6d0de5e
fix(biome_grit_patterns): replace expect() with error propagation in …
chocky335 d2f7fb2
fix(biome_service): handle growth guard check in record_text_edit_fix
chocky335 925ddeb
test(biome_cli): assert error result in check_plugin_rewrite_no_write
chocky335 2eabba2
fix(biome_service): provide rule name in ConflictingRuleFixesError fo…
chocky335 0ada54b
fix(biome_grit_patterns): add debug_assert for overlapping replacemen…
chocky335 66d0723
[autofix.ci] apply automated fixes
autofix-ci[bot] 6d59b1a
refactor(biome_analyze): rename with_actions to with_plugin_actions
chocky335 fd7a55c
refactor(biome_service): move plugin text edit logic to ProcessFixAll
chocky335 7deb504
feat(biome_service): support plugin rewrites for CSS and JSON
chocky335 12549f9
fix(biome_grit_patterns): return error for overlapping replacements
chocky335 e4ca833
test(biome_cli): add --write only test for plugin rewrites
chocky335 433b19f
test(biome_cli): add CSS and JSON plugin rewrite tests
chocky335 f11eb65
test(biome_lsp): add test for plugin rewrite diagnostics
chocky335 9dc4fd8
chore: update changeset to reflect CSS/JSON support and unsafe-only f…
chocky335 9937031
Merge remote-tracking branch 'upstream/next' into feat/fixable-gritql…
chocky335 e545ebb
fix(biome_service): use settings-derived parser options for plugin re…
chocky335 faa7979
fix: use correct severity string in plugin tests
chocky335 c7858f8
refactor(biome_analyze): pair plugin diagnostics with actions in Plug…
chocky335 c44a237
feat(biome_plugin_loader): add fix_kind parameter to register_diagnostic
chocky335 16ec315
test(biome_cli): add tests for safe plugin fix_kind
chocky335 e8826fa
fix(biome_grit_patterns): harden rewrite linearization edge cases
chocky335 b7dc304
fix(biome_grit_patterns): improve rewrite linearization error messages
chocky335 04582ab
fix(biome_plugin_loader): error on invalid severity and fix_kind values
chocky335 bad2d3d
test(biome_cli): add tests for invalid fix_kind and severity
chocky335 4cffff9
fix(biome_plugin_loader): improve severity error message consistency
chocky335 72df848
fix(biome_plugin_loader): separate log entries from action pairing
chocky335 11f2bc5
fix(biome_plugin_loader): check missing span only on diagnostic entries
chocky335 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| "@biomejs/biome": minor | ||
| --- | ||
|
|
||
| Added support for applying GritQL plugin rewrites as code actions. GritQL plugins that use the rewrite operator (`=>`) now produce fixable diagnostics for JavaScript, CSS, and JSON files. By default, plugin rewrites are treated as unsafe fixes and require `--write --unsafe` to apply. Plugin authors can pass `fix_kind = "safe"` to `register_diagnostic()` to mark a fix as safe, allowing it to be applied with just `--write`. | ||
|
|
||
| **Example plugin** (`useConsoleInfo.grit`): | ||
| ```grit | ||
| language js | ||
|
|
||
| `console.log($msg)` as $call where { | ||
| register_diagnostic(span = $call, message = "Use console.info instead of console.log.", severity = "warn", fix_kind = "safe"), | ||
| $call => `console.info($msg)` | ||
| } | ||
| ``` | ||
|
|
||
| Running `biome check --write` applies safe rewrites. Unsafe rewrites (the default, or `fix_kind = "unsafe"`) still require `--write --unsafe`. | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.