Skip to content

feat(BREAKING): let process plugins allow other plugins to change their non-global config - #1457

Merged
dsherret merged 2 commits into
mainfrom
process-plugin-override-config
Nov 7, 2026
Merged

dsherret merged 2 commits into
mainfrom
process-plugin-override-config

Conversation

@dsherret

@dsherret dsherret commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #1397, which only let a plugin change the global configuration of every process plugin when formatting text with it (ex. a code block). Most process plugins have no configuration that's dangerous to change, so now the process plugin decides.

  • dprint-core's PluginInfo.supports_range_formatting is now a bool instead of an Option<bool>.
  • Process plugins now return a new ProcessPluginInfo, which wraps PluginInfo and adds allow_plugin_override_config: bool. When true, another plugin may change the plugin's non-global configuration. When false, it can only change the global configuration (lineWidth, indentWidth, useTabs and newLineKind). dprint-plugin-exec should keep this false because its config says what commands to run.
  • The CLI reads plugin info into its own ReceivedPluginInfo, where these are Option<bool> for plugins made with an older dprint-core. A process plugin that doesn't provide allowPluginOverrideConfig is treated as false, so older versions of dprint-plugin-exec stay protected.
  • dprint-core's PluginInfo and ProcessPluginInfo no longer implement Deserialize, since the CLI uses its own type to read them.

This is breaking for plugin authors because of the required properties and the new type for process plugins.

@dsherret
dsherret merged commit 9c48f60 into main Nov 7, 2026
7 checks passed
@dsherret
dsherret deleted the process-plugin-override-config branch November 7, 2026 15:38
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