Docs updates for .ex/.exs plugin behavior - #15809
Merged
josevalim merged 4 commits intoAug 29, 2026
Merged
Conversation
Member
|
Can you please update the PR to only have the docs? The tests are unnecessary because they are all consequence of a single decision of overriding the formatter, which is already tested. Thanks! |
…et .ex/.exs" This reverts commit 53885b0.
Contributor
Author
|
Sure thing, done in 9e365c4. Left the commits for posterity since it sounds like PRs are squashed anyway, but lmk if you prefer dropping them entirely. |
Clarify behavior of custom Elixir formatters and their interaction with baseline formatting.
Member
|
💚 💙 💜 💛 ❤️ |
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.
This adds a section to Mix Format docs based on discussion here: #15742
I believe this is helpful because the current behavior of
mix formatseems a bit unintuitive when it comes to plugins targeting.ex/.exsfile types. I had read the docs thoroughly beforehand, so this addition is what would have helped shortcut me to full understanding. It would have saved at least one person (me) some time figuring things out through experimentation and discussion.I've tried to be as accurate and terse as I can with the technical wording, but am of course happy to revise and be further informed of gaps in my understanding! Just hope this is helpful to others working with plugins going forward.
The following test cases are added, to cover these aspects ofmix formatbehavior:a plugin that targets.ex/.exsdisables baseline code formatting of these filesa plugin that targets.ex/.exsdisables sigil-plugin formatting in these filesa plugin that callsCode.format_string!may be used to restore both baseline code formatting and sigil-plugin formattingHere is a screen capture of the new section added to the docs: