Skip to content

Commit 31c73e8

Browse files
committed
Add black and isort auto-formatting on save
1 parent 4c6b72f commit 31c73e8

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.devcontainer/devcontainer.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@
1616

1717
// The optional 'workspaceFolder' property is the path VS Code should open by default when
1818
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
19-
"workspaceFolder": "/srv/app/"
19+
"workspaceFolder": "/srv/app/",
20+
"customizations": {
21+
"vscode": {
22+
"extensions": [
23+
"ms-python.python",
24+
"ms-python.black-formatter",
25+
"ms-python.isort"
26+
]
27+
}
28+
}
2029

2130
// Features to add to the dev container. More info: https://containers.dev/features.
2231
// "features": {},

.vscode/settings.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,16 @@
33
"."
44
],
55
"python.testing.unittestEnabled": false,
6-
"python.testing.pytestEnabled": true
6+
"python.testing.pytestEnabled": true,
7+
"[python]": {
8+
"editor.defaultFormatter": "ms-python.black-formatter",
9+
"editor.formatOnSave": true,
10+
"editor.codeActionsOnSave": {
11+
"source.organizeImports": true
12+
},
13+
},
14+
"isort.args": [
15+
"--profile",
16+
"black"
17+
],
718
}

0 commit comments

Comments
 (0)