Configure VS Code to auto-format code with YAPF (#707)

This commit is contained in:
Michael Lynch
2021-05-24 18:38:00 -04:00
committed by GitHub
parent e7fb450478
commit 2cf03a71d7
4 changed files with 7 additions and 7 deletions

2
.style.yapf Normal file
View File

@@ -0,0 +1,2 @@
[style]
based_on_style = google

View File

@@ -5,8 +5,10 @@
"editor.formatOnSave": false
},
"[python]": {
"editor.defaultFormatter": "ms-python.python",
"editor.tabSize": 4
},
"python.formatting.provider": "yapf",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.linting.lintOnSave": true

2
.yapfignore Normal file
View File

@@ -0,0 +1,2 @@
third_party/*
venv/*

View File

@@ -32,13 +32,7 @@ coverage run \
coverage report
# Check that source has correct formatting.
yapf \
--diff \
--recursive \
--style google \
./ \
--exclude=third_party/* \
--exclude=venv/*
yapf --diff --recursive ./
# Check correct sorting for imports.
isort \