-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Disable formatting on save for Dart and HTML files #122048
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
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
test-exempt: configuration change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a suggestion.
FWIW, I think this will only apply if you open up the repo root, and not just some individual packages (as I do, although I use a .code-workspace
file that disables these).
I also think these aren't defaults in VS Code, but we do have them as "recommended settings" for Dart (so if you accept the prompt to use recommended settings on first run, they'll be added to your User Settings in the "[dart]"
section). If we think this is the wrong thing, we can change it.
(it would perhaps also be nice if this could be set in a non-VS-Code specific way, although I don't have a good place in mind)
Adds a default workspace settings file for VSCode (one of the primary editors used by Flutter contributors) to ensure that it doesn't format on save by default while contributors are making changes to the Flutter repository.
It's frustratingly common that someone makes a good change, saves it, and then realizes to their horror that they have reformatted the entire class file. They then have to go through and revert the formatting changes while retaining the semantic changes they've made, a time-consuming and somewhat error-prone process. Adding this file to override the default VSCode settings will remove one tripwire for new contributors to the project.
Fixes #122050. This change should be test-exempt since it only adds a configuration file.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.