diff options
| author | Timothy Crosley <timothy.crosley@gmail.com> | 2019-10-13 23:53:41 -0700 |
|---|---|---|
| committer | Timothy Crosley <timothy.crosley@gmail.com> | 2019-10-13 23:53:41 -0700 |
| commit | 56aa368fc7e62bd98ffacbb4e393d2d7e6b3b304 (patch) | |
| tree | 3596da7bcb76c417158ec39cde90199b7900ed4e /scripts | |
| parent | 2be31385349bb92cb1d0cbc30ee175ac00ec3db2 (diff) | |
| download | isort-56aa368fc7e62bd98ffacbb4e393d2d7e6b3b304.tar.gz | |
Skip 3.6+ linters on 3.5
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/lint.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/lint.sh b/scripts/lint.sh index 3e5bff7f..fb1434b7 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,10 +1,19 @@ #!/bin/bash set -euxo pipefail -poetry run cruft check -poetry run mypy --ignore-missing-imports isort/ +version=$(python3 -V 2>&1 | grep -Po '(?<=Python )(.+)') +parsedVersion=$(echo "${version//./}") + +if [[ "$parsedVersion" -lt "360" ]] +then + echo "WARNING: Some linters have been skipped. Run against 3.6+ for full set of linters to run against the project!" +else + poetry run cruft check + poetry run mypy --ignore-missing-imports isort/ + poetry run black --check -l 100 isort/ tests/ +fi + poetry run isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses --line-width=100 --recursive --check --diff --recursive isort/ tests/ -poetry run black --check -l 100 isort/ tests/ poetry run flake8 isort/ tests/ --max-line 100 --ignore F403,F401,W503,E203 poetry run safety check poetry run bandit -r isort/ |
