summaryrefslogtreecommitdiff
path: root/.github/workflows/lint.yml
blob: ac7f9ca39fc0f2640eb167c1e1ad3eb55033c916 (plain)
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
name: Lint
on: [push, pull_request]

jobs:
  lint:
    strategy:
      matrix:
        python-version: [3.8]
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 30
    steps:
    - uses: actions/checkout@v3
    - name: Cache for pip
      uses: actions/cache@v3
      id: cache-pip
      with:
        path: ~/.cache/pip
        key: ${{ matrix.os }}-cache-pip

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}

    - name: Critical lint
      run: |
        pip install flake8
        flake8 . --count --select=E9,F63,F7,E71 --show-source --statistics --exclude=android-?dk  # TODO: Add F82

    - name: Style lint
      run: |
        flake8 pwnlib setup.py docs travis --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
        flake8 examples --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore='F403,F405'
        flake8 pwn --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore='F401,F403,F405'