-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
repos: | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 23.9.1 | ||
hooks: | ||
- id: black | ||
args: | ||
- --quiet | ||
files: ^((zwave_js_server|scripts|test)/.+)?[^/]+\.py$ | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: no-commit-to-branch | ||
args: | ||
- --branch=master | ||
- repo: https://github.com/pycqa/pydocstyle | ||
rev: 6.3.0 | ||
hooks: | ||
- id: pydocstyle | ||
files: ^(zwave_js_server|test)/.+\.py$ | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 | ||
files: ^((zwave_js_server|test)/.+)?[^/]+\.py$ | ||
- repo: local | ||
hooks: | ||
- id: mypy | ||
name: mypy | ||
entry: scripts/run-in-env.sh mypy | ||
language: script | ||
types: [python] | ||
require_serial: true | ||
files: ^(zwave_js_server)/.+\.py$ | ||
- id: pylint | ||
name: pylint | ||
entry: scripts/run-in-env.sh pylint -j 0 --ignore-missing-annotations=y | ||
language: script | ||
types: [python] | ||
files: ^zwave_js_server/.+\.py$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ mypy==1.5.1 | |
pydocstyle==6.3.0 | ||
pylint==3.0.1 | ||
pylint-strict-informational==0.1 | ||
pre-commit==3.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env sh | ||
set -eu | ||
|
||
# Activate pyenv and virtualenv if present, then run the specified command | ||
|
||
# pyenv, pyenv-virtualenv | ||
if [ -s .python-version ]; then | ||
PYENV_VERSION=$(head -n 1 .python-version) | ||
export PYENV_VERSION | ||
fi | ||
|
||
# other common virtualenvs | ||
my_path=$(git rev-parse --show-toplevel) | ||
|
||
for venv in venv .venv .; do | ||
if [ -f "${my_path}/${venv}/bin/activate" ]; then | ||
. "${my_path}/${venv}/bin/activate" | ||
break | ||
fi | ||
done | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
# Setups the repository. | ||
|
||
# Stop on errors | ||
set -e | ||
|
||
if [ ! -n "$DEVCONTAINER" ] && [ ! -n "$VIRTUAL_ENV" ];then | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
fi | ||
|
||
python3 -m pip install -r requirements_dev.txt | ||
|
||
pre-commit install |