Skip to content

Commit

Permalink
lint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ponty committed Jan 18, 2022
1 parent b5d8788 commit d8c04dd
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 11 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,13 @@ jobs:
Xvfb -help
- name: pip install
run: |
python -m pip install flake8 pytest
python -m pip install .
pip install -r requirements-test.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
cd tests
pytest -v .
- name: Lint
if: matrix.os == 'ubuntu-20.04'
run: |
./lint.sh
4 changes: 2 additions & 2 deletions format-code.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#!/bin/bash
set -e
autoflake -i -r --remove-all-unused-imports .
autoflake -i -r --remove-unused-variables .
isort --recursive .
isort .
black .
4 changes: 4 additions & 0 deletions lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e
python3 -m flake8 . --max-complexity=10 --max-line-length=127 --extend-ignore=E203
python3 -m mypy "pyvirtualdisplay"
12 changes: 12 additions & 0 deletions requirements-doc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
autoflake
isort
black

# pytest
pillow
entrypoint2
vncdotool==0.13.0
# psutil
# for travis xenial
# attrs
# pytest-xdist
4 changes: 3 additions & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ vncdotool==0.13.0
psutil
# for travis xenial
attrs
pytest-xdist
pytest-xdist
mypy
flake8
15 changes: 14 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ envlist =
py38
py37
py36
py3-doc
py3-lint

# Workaround for Vagrant
#toxworkdir={toxinidir}/.tox # default
Expand Down Expand Up @@ -34,8 +36,19 @@ commands=


[testenv:py3-doc]
allowlist_externals=bash
changedir=doc
deps = -rrequirements-test.txt
deps =
-rrequirements-doc.txt

commands=
bash -c "cd ..;./format-code.sh"
{envpython} generate-doc.py --debug

[testenv:py3-lint]
allowlist_externals=bash
changedir=.
deps = -rrequirements-test.txt

commands=
bash -c "./lint.sh"

0 comments on commit d8c04dd

Please sign in to comment.