Skip to content

Commit

Permalink
GitHub Action to lint Python code
Browse files Browse the repository at this point in the history
Because Travis Ci is on vacation.
  • Loading branch information
cclauss authored and Diaoul committed Nov 19, 2021
1 parent a4113ad commit e25589d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: lint_python
on: [pull_request, push]
jobs:
lint_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install --upgrade pip wheel
- run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear
flake8-comprehensions isort mypy pytest pyupgrade safety
- run: bandit --recursive --skip B101,B105,B106,B303,B314,B404,B405,B410,B603 .
- run: black --check . || true
- run: codespell --ignore-words-list=nd,reacher,serie --skip="*.yaml"
- run: flake8 --ignore=B001,C401,C405,C408,C416,E122,E127,E128,E226,E265,E402,E722,E741,F401,R502,R503,R504,W504,W605
--count --max-complexity=36 --max-line-length=120 --show-source --statistics .
- run: isort --check-only --profile black . || true
- run: pip install -r dev-requirements.txt -r requirements.txt
- run: mkdir --parents --verbose .mypy_cache
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true
- run: pytest --doctest-modules . || true
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
- run: safety check
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[pytest]
norecursedirs = build dist env .tox .eggs
addopts = --pep8 --flakes --doctest-glob='*.rst'
addopts = --doctest-glob='*.rst'
pep8maxlinelength = 120
pep8ignore =
docs/conf.py ALL
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def find_version(*file_paths):
if sys.version_info < (3, 2):
install_requirements.append('futures>=3.0')

test_requirements = ['sympy', 'vcrpy>=1.6.1', 'pytest', 'pytest-pep8', 'pytest-flakes', 'pytest-cov']
test_requirements = ['sympy', 'vcrpy>=1.6.1', 'pytest', 'pytest-flakes', 'pytest-cov']
if sys.version_info < (3, 3):
test_requirements.append('mock')

Expand Down
2 changes: 1 addition & 1 deletion subliminal/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def scan_archive(path):
# Get filename and file size from RAR
rar = RarFile(path)

# check that the rar doesnt need a password
# check that the rar doesn't need a password
if rar.needs_password():
raise ValueError('Rar requires a password')

Expand Down

0 comments on commit e25589d

Please sign in to comment.