-
Notifications
You must be signed in to change notification settings - Fork 23
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
10 changed files
with
530 additions
and
583 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 |
---|---|---|
@@ -1,23 +1,65 @@ | ||
name: lint_python | ||
name: ci | ||
on: [pull_request, push] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
jobs: | ||
lint_python: | ||
test: | ||
strategy: | ||
matrix: | ||
config: | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
- "pypy-3.7" | ||
runs-on: ubuntu-latest | ||
name: ${{matrix[1]}} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- run: pip install --upgrade pip wheel | ||
- run: pip install bandit black codespell flake8 flake8-bugbear isort | ||
mypy pytest pyupgrade safety # flake8-comprehensions | ||
- run: bandit --recursive --skip B101 . # B101 is assert statements | ||
- run: black --check --skip-string-normalization . | ||
- run: codespell | ||
- run: flake8 . --count --max-complexity=18 --max-line-length=88 --show-source --statistics | ||
- run: isort --check-only --profile black . | ||
- run: pip install -r requirements.txt | ||
- run: mkdir --parents --verbose .mypy_cache | ||
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true | ||
- run: pytest run_tests.py --cov flake8_builtins --cov-report term-missing | ||
- run: coveralls || true | ||
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true | ||
- run: safety check || true | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.config }} | ||
- name: Cache packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ matrix.config }}-${{ hashFiles('requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{ matrix.config }}- | ||
- name: pip version | ||
run: pip --version | ||
- name: Install dependencies | ||
run: python -m pip install -r requirements.txt | ||
# formatters | ||
- name: Run pyupgrade | ||
if: matrix.config == '3.9' | ||
run: pyupgrade --py37-plus *.py | ||
- name: Run isort | ||
if: matrix.config == '3.9' | ||
run: isort --check-only *.py | ||
- name: Run black | ||
if: matrix.config == '3.9' | ||
run: black --check --skip-string-normalization *.py | ||
# linters | ||
- name: Lint with bandit | ||
if: matrix.config == '3.9' | ||
run: bandit --skip B101 *.py # B101 is assert statements | ||
- name: Lint with codespell | ||
if: matrix.config == '3.9' | ||
run: codespell *.rst *.py | ||
- name: Lint with flake8 | ||
if: matrix.config == '3.9' | ||
run: flake8 *.py --count --max-complexity=18 --max-line-length=88 --show-source --statistics | ||
- name: Lint with mypy | ||
if: matrix.config == '3.9' | ||
run: | | ||
mkdir --parents --verbose .mypy_cache | ||
mypy --ignore-missing-imports --install-types --non-interactive *.py || true | ||
- name: Lint with safety | ||
if: matrix.config == '3.9' | ||
run: safety check || true | ||
# tests and coverage | ||
- name: Test | ||
run: pytest run_tests.py --cov flake8_builtins --cov-report term-missing | ||
- name: Coverage | ||
run: coveralls --service=github |
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,7 +4,7 @@ | |
.cache | ||
.coverage | ||
.installed.cfg | ||
.tox | ||
.hypothesis | ||
bin | ||
develop-eggs | ||
include | ||
|
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
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 |
---|---|---|
@@ -1,22 +1,23 @@ | ||
bandit | ||
black | ||
codespell | ||
coveralls | ||
flake8-blind-except | ||
flake8-coding | ||
flake8-commas | ||
flake8-bugbear | ||
flake8-comprehensions | ||
flake8-debugger | ||
flake8-deprecated | ||
flake8-isort | ||
flake8-pep3101 | ||
flake8-polyfill | ||
flake8-print | ||
flake8-quotes | ||
flake8-string-format | ||
flake8-todo | ||
futures; python_version < '3.0' | ||
hypothesis; python_version >= '3.6' | ||
hypothesmith; python_version >= '3.6' | ||
mock ; python_version < '3.0' | ||
pytest<5; python_version < '3.0' | ||
pytest>5; python_version >= '3.0' | ||
importlib-metadata; python_version < '3.8' | ||
isort | ||
mypy | ||
pytest | ||
pytest-cov | ||
more-itertools==5.0.0 | ||
zipp ; python_version >= '3.0' | ||
pyupgrade | ||
safety | ||
typed-ast; python_version < '3.8' # dependency of black and mypy | ||
zipp; python_version < '3.8' # dependency of importlib-metadata |
Oops, something went wrong.