Skip to content

feat: let plugins skip formatting until the output is stable - #1469

Merged
dsherret merged 6 commits into
mainfrom
feat/plugin-skip-stable-format
Nov 27, 2026
Merged

dsherret merged 6 commits into
mainfrom
feat/plugin-skip-stable-format

Conversation

@dsherret

@dsherret dsherret commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Adds PluginInfo::skip_stable_format (skipStableFormat in the plugin info JSON) for plugins that are sure formatting their output again never changes it with any configuration. By default, dprint formats text a plugin changed again until it stops changing, which means formatting each changed file at least one more time.

  • dprint fmt (including stdin), the editor service, and the LSP skip that only when every plugin formatting the file sets it.
  • When they skip it, the text those plugins format with other plugins (ex. code blocks) is made stable instead unless those plugins also set it. Each nested level decides the same way.
  • Plugins made before this existed don't provide it, so it defaults to false and they keep getting a stable format.
  • Bumps dprint-core to 0.78.0 since this adds a required field to PluginInfo.

Adds `PluginInfo::skip_stable_format` for plugins that are sure formatting
their output again never changes it, so dprint doesn't format each changed
file at least one more time. Bumps dprint-core to 0.78.0.
Moves `skip_stable_format` from `PluginInfo` to `FileMatchingInfo` since the
config can change whether the output is stable (ex. formatting embedded text
with other plugins). It's not used when config overrides apply to the file.
…ps stable format

When every plugin formatting a file skips formatting it again until it's stable,
the text those plugins format with other plugins (ex. code blocks) is made stable
instead unless those plugins say the same.
…ig applies

When the plugin's configuration says to skip stable format and override config
applies to a file, ask the plugin for the file matching info of the configuration
with the override config merged in instead of always formatting until stable.
A plugin is either all in or all out, which removes asking the plugin about
override config. Text the plugin formats with other plugins is still made stable
unless those plugins also skip it.
@dsherret
dsherret merged commit 49a2085 into main Nov 27, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant