Skip to content

Commit

Permalink
chore: improve formatting behavior
Browse files Browse the repository at this point in the history
This does a few things:

- Sets the default formatter to be Prettier, which will also apply it to things like Markdown.
- Formats on save by default, which is fine because formatting HTML is still disabled, protecting the Jinja templates.
- Formats the settings files (with Prettier).
  • Loading branch information
afeld committed Jun 27, 2022
1 parent f6034d8 commit 842c9e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 40 deletions.
20 changes: 4 additions & 16 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json
{
"name": "cal-itp/benefits",
"dockerComposeFile": [
"compose.yml"
],
"dockerComposeFile": ["compose.yml"],
"service": "dev",
"runServices": [
"dev",
"docs",
"server"
],
"runServices": ["dev", "docs", "server"],
"workspaceFolder": "/home/calitp/app",
"postStartCommand": [
"/bin/bash",
"bin/init.sh"
],
"postAttachCommand": [
"/bin/bash",
".devcontainer/postAttach.sh"
],
"postStartCommand": ["/bin/bash", "bin/init.sh"],
"postAttachCommand": ["/bin/bash", ".devcontainer/postAttach.sh"],
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.defaultProfile.linux": "bash",
Expand Down
30 changes: 6 additions & 24 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"[css]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.defaultFormatter": null,
"editor.formatOnSave": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[html]": {
"editor.formatOnSave": false
},
Expand All @@ -13,24 +8,11 @@
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"python.formatting.provider": "black",
"python.linting.flake8Enabled": true,
"python.linting.enabled": true,
"python.languageServer": "Pylance",
"[python]": {
"editor.formatOnSave": true
},
"python.testing.pytestArgs": [
"tests/pytest", "--import-mode=importlib"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.testing.pytestArgs": ["tests/pytest", "--import-mode=importlib"],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false
}

0 comments on commit 842c9e1

Please sign in to comment.