Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/.github/workflows/lint-python.yaml
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-05-24 12:34:32 +0200
committerAnton Hvornum <anton.feeds@gmail.com>2021-05-24 12:34:32 +0200
commit9b0de26c67b6bb90b69d5b4ef874dc0bed407a77 (patch)
tree69f1b5e0b6ad48018ce9e18d6d74079bfb123540 /.github/workflows/lint-python.yaml
parent404197dc93c2efb24097772848af708d833bdd98 (diff)
parent7daaf1143fca2723bfb63ab4e3030485446da1c0 (diff)
Syncing in latest changes from master
Diffstat (limited to '.github/workflows/lint-python.yaml')
-rw-r--r--.github/workflows/lint-python.yaml40
1 files changed, 40 insertions, 0 deletions
diff --git a/.github/workflows/lint-python.yaml b/.github/workflows/lint-python.yaml
new file mode 100644
index 00000000..6e6ab071
--- /dev/null
+++ b/.github/workflows/lint-python.yaml
@@ -0,0 +1,40 @@
+on: [ push, pull_request ]
+name: Lint Python and Find Syntax Errors
+jobs:
+ mypy:
+ runs-on: ubuntu-latest
+ container:
+ image: archlinux:latest
+ steps:
+ - uses: actions/checkout@v2
+ - run: pacman --noconfirm -Syu python mypy
+ - name: run mypy
+ run: mypy . --ignore-missing-imports || exit 0
+ flake8:
+ runs-on: ubuntu-latest
+ container:
+ image: archlinux:latest
+ steps:
+ - uses: actions/checkout@v2
+ - run: pacman --noconfirm -Syu python python-pip
+ - run: python -m pip install --upgrade pip
+ - run: pip install flake8
+ - name: Lint with flake8
+ run: |
+ # stop the build if there are Python syntax errors
+ flake8 . --count --select=E9,F63,F7 --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
+ pytest:
+ runs-on: ubuntu-latest
+ container:
+ image: archlinux:latest
+ steps:
+ - uses: actions/checkout@v2
+ - run: pacman --noconfirm -Syu python python-pip
+ - run: python -m pip install --upgrade pip
+ - run: pip install pytest
+ # TODO: Add tests and enable pytest checks.
+# - name: Test with pytest
+# run: |
+# pytest