Skip to content

Commit a0b7a6b

Browse files
authored
Adjust repo config for VS Code formatting (flutter#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 flutter#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.
1 parent 607e641 commit a0b7a6b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.vscode/settings.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44
// VSCode formats files on save by default. Since Flutter source code is
55
// hand-formatted, the default settings are changed to prevent inadvertent
66
// reformatting of code.
7-
"editor.formatOnSave": false,
8-
"editor.formatOnType": false,
7+
"[dart]": {
8+
"editor.formatOnSave": false,
9+
"editor.formatOnType": false,
10+
"editor.formatOnPaste": false,
11+
},
912

1013
"html.format.enable": false,
1114
"githubPullRequests.ignoredPullRequestBranches": [
1215
"master"
13-
]
14-
}
16+
],
17+
"files.trimTrailingWhitespace": true
18+
}

0 commit comments

Comments
 (0)