From 02acdba509560e9faf5bda6846249dc9d2e60840 Mon Sep 17 00:00:00 2001 From: wingdeans <66850754+wingdeans@users.noreply.github.com> Date: Sun, 17 Jul 2022 04:53:43 +0000 Subject: [PATCH] Add python typechecking/linting with mypy, pyflakes, and black --- .github/workflows/lint.yml | 20 ++++++++++++++++++++ src/main.py | 1 - src/module_class.py | 1 - 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7213d02..f19edb3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,3 +8,23 @@ jobs: uses: actions/checkout@v3 - name: REUSE compliance check uses: fsfe/reuse-action@v1 + + python: + runs-on: ubuntu-latest + steps: + - name: Checkout rz-bindgen + uses: actions/checkout@v3 + - name: Install tools + run: | + pip install mypy pyflakes black + - name: Run mypy + run: | + mypy src/main.py + if: ${{ always() }} + - name: Run pyflakes + run: | + pyflakes src/*.py + if: ${{ always() }} + - name: Run black + run: | + black --check --diff src/*.py diff --git a/src/main.py b/src/main.py index a067921..3205ad7 100644 --- a/src/main.py +++ b/src/main.py @@ -158,7 +158,6 @@ cons_h, typedef="RzCons", rename_fields={ - "flush": "_flush", "lastline": "_lastline", "echo": "_echo", "highlight": "_highlight", diff --git a/src/module_class.py b/src/module_class.py index cf53ba2..310de8e 100644 --- a/src/module_class.py +++ b/src/module_class.py @@ -8,7 +8,6 @@ from typing import List, Dict, Optional from clang.wrapper import ( - Cursor, CursorKind, Struct, StructField,