Add tox configuration and Github action for linting.

This commit is contained in:
Mikaël Capelle
2020-08-03 19:19:25 +02:00
parent 836595d2a2
commit c6f25e6888
4 changed files with 44 additions and 3 deletions
+24
View File
@@ -0,0 +1,24 @@
name: linters
on: [push]
jobs:
checks:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test with tox
run: tox -e py38-lint
+2 -1
View File
@@ -1,2 +1,3 @@
.mypy_cache
__pycache__
__pycache__
.tox
+15 -1
View File
@@ -7,4 +7,18 @@ extend-ignore =
[mypy]
warn_return_any = True
warn_unused_configs = True
warn_unused_configs = True
[tox:tox]
skipsdist = true
envlist = py38-lint
[testenv:py36-lint]
skip_install = true
deps =
black
flake8
flake8-black
commands =
black --check --diff setup.py deel tests
flake8 deel tests
+3 -1
View File
@@ -27,7 +27,9 @@ class LibraryFolder:
self.games = []
for filename in os.listdir(os.path.join(path, "steamapps")):
if filename.startswith("appmanifest"):
with open(os.path.join(path, "steamapps", filename), "r", encoding="utf-8") as fp:
with open(
os.path.join(path, "steamapps", filename), "r", encoding="utf-8"
) as fp:
i, n = None, None
for line in fp:
line = line.strip()