From fb48a502576228f2e655771497305ec5579cffd2 Mon Sep 17 00:00:00 2001 From: Camen Date: Fri, 3 Jul 2020 11:55:57 -0700 Subject: [PATCH 1/2] Add black style check on lint --- scripts/lint.sh | 5 ++++- scripts/test.sh | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/lint.sh b/scripts/lint.sh index 2c6277ffb..08d1141f4 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,7 +1,10 @@ #!/bin/bash - set -ex # fail on first error, print commands +echo "Checking code style with black...." +python -m black bambi --line-length=100 --target-version=py37 --exclude=tests/ --check +echo "Success!" + echo "Checking code style with pylint..." python -m pylint bambi/ echo "Success!" diff --git a/scripts/test.sh b/scripts/test.sh index 6840a70be..d9f7af136 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,10 +1,7 @@ #!/bin/bash - set -ex # fail on first error, print commands -echo "Checking code style with pylint..." -python -m pylint bambi/ -echo "Success!" +scripts/lint.sh echo "Running unit tests..." python -m pytest -vx --cov=bambi From f2c111e891c4385954b8b5a7b5dd61031a72fd0c Mon Sep 17 00:00:00 2001 From: Camen Date: Fri, 3 Jul 2020 12:02:31 -0700 Subject: [PATCH 2/2] add black to create_testenv script for travisCI --- scripts/create_testenv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create_testenv.sh b/scripts/create_testenv.sh index 33d7eaa4d..1db6675d1 100644 --- a/scripts/create_testenv.sh +++ b/scripts/create_testenv.sh @@ -21,7 +21,7 @@ if [[ $* != *--global* ]]; then fi fi -conda install --yes pip pytest numpy matplotlib pandas patsy statsmodels +conda install --yes pip pytest numpy matplotlib pandas patsy statsmodels black pip install --upgrade pip