forked from libtcod/python-tcod
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (51 loc) · 1.76 KB
/
python-lint.yml
File metadata and controls
54 lines (51 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-20.04
env:
python-version: "3.9"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout submodules
run: |
git submodule update --init --recursive --depth 1
- name: Set up Python ${{ env.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 mypy black isort pytest types-tabulate
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Fake initialize package
run: |
echo '__version__ = ""' > tcod/version.py
- name: Flake8
uses: liskin/gh-problem-matcher-wrap@v1
with:
linters: flake8
run: flake8 scripts/ tcod/ tests/
- name: MyPy
if: always()
uses: liskin/gh-problem-matcher-wrap@v1
with:
linters: mypy
run: mypy --show-column-numbers .
- name: isort
uses: liskin/gh-problem-matcher-wrap@v1
with:
linters: isort
run: isort scripts/ tcod/ tests/ --check
- name: isort (examples)
uses: liskin/gh-problem-matcher-wrap@v1
with:
linters: isort
run: isort examples/ --check --thirdparty tcod
- name: Black
run: |
black --check examples/ scripts/ tcod/ tests/ *.py