From a0b7a6b692e415052b8d8e99616a29803055ab9f Mon Sep 17 00:00:00 2001 From: Pierre-Louis <6655696+guidezpl@users.noreply.github.com> Date: Fri, 14 Apr 2023 10:35:42 +0000 Subject: [PATCH] Adjust repo config for VS Code formatting (#122758) If someone's user settings include the following, the current workspace level formatting settings don't apply since they aren't as specific. ``` "[dart]": { "editor.formatOnSave": true, "editor.formatOnType": true, } ``` This PR handles this by turning off auto-formatting specifically for Dart files. This PR also adds `"files.trimTrailingWhitespace": true` to simplify [contribution guide](https://github.com/flutter/flutter/wiki/Setting-up-the-Framework-development-environment#set-up-your-environment). Fixes https://github.com/flutter/flutter/issues/122050. This change is test-exempt. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. --- .vscode/settings.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f5aad5c6d14..b46ed90307f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,11 +4,15 @@ // VSCode formats files on save by default. Since Flutter source code is // hand-formatted, the default settings are changed to prevent inadvertent // reformatting of code. - "editor.formatOnSave": false, - "editor.formatOnType": false, + "[dart]": { + "editor.formatOnSave": false, + "editor.formatOnType": false, + "editor.formatOnPaste": false, + }, "html.format.enable": false, "githubPullRequests.ignoredPullRequestBranches": [ "master" - ] -} \ No newline at end of file + ], + "files.trimTrailingWhitespace": true +}