Skip to content

Commit

Permalink
fix: Improve how precommit hooks work in codespace (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
dciborow authored Mar 13, 2023
1 parent 658ed2c commit d5f8efc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
3 changes: 0 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ RUN touch README.md \
&& mkdir -p src/python_package \
&& python -m flit install --only-deps --deps develop \
&& rm -r pyproject.toml README.md src

COPY .pre-commit-config.yaml .
RUN git init . && pre-commit install-hooks
13 changes: 7 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.pylint",
"ms-python.isort",
"ms-python.flake8",
"ms-python.black-formatter",
"ms-vsliveshare.vsliveshare",
Expand All @@ -24,10 +25,6 @@
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.formatting.provider": "black",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"black-formatter.path": [
"/usr/local/py-utils/bin/black"
],
Expand All @@ -36,8 +33,12 @@
],
"flake8.path": [
"/usr/local/py-utils/bin/flake8"
],
"isort.path": [
"/usr/local/py-utils/bin/isort"
]
}
}
}
}
},
"onCreateCommand": "pre-commit install-hooks"
}
10 changes: 2 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@
"pylint.args": [
"--rcfile=pyproject.toml"
],
"pylint.path": [
"/usr/local/py-utils/bin/pylint"
],
"black-formatter.args": [
"--config=pyproject.toml"
],
"black-formatter.path": [
"/usr/local/py-utils/bin/black"
],
"flake8.args": [
"--toml-config=pyproject.toml"
],
"flake8.path": [
"/usr/local/py-utils/bin/flake8"
"isort.args": [
"--settings-path=pyproject.toml"
]
}

0 comments on commit d5f8efc

Please sign in to comment.