From 1e872e75e2ad14aa8b62ef161aa072c571bc5994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kuranowski?= Date: Sun, 28 Apr 2024 10:48:38 +0200 Subject: [PATCH] Add black, isort and pyright to CI --- .github/workflows/test.yml | 19 +++++++++++++++++++ pyproject.toml | 10 ++++++++++ requirements.dev.txt | 3 +++ 3 files changed, 32 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 143d7be..600636e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,3 +19,22 @@ jobs: run: pip install -e . - name: Run tests run: pytest + lint: + name: Lint code + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: "3.8" + - name: Install dependencies + run: pip install -Ur requirements.dev.txt + - name: Check code formatting + run: black --check . + - name: Check imports order + run: isort --check . + - name: Install the library + run: pip install -e . + - name: Run typechecking + run: pyright diff --git a/pyproject.toml b/pyproject.toml index de56fda..ef8f80a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,3 +30,13 @@ aiocsv = ["py.typed"] [tool.setuptools.dynamic] version = {attr = "aiocsv.__version__"} + +[tool.black] +line-length = 99 + +[tool.isort] +profile = "black" +line_length = 99 + +[tool.pyright] +typeCheckingMode = "strict" diff --git a/requirements.dev.txt b/requirements.dev.txt index 609203e..7ed9025 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -3,3 +3,6 @@ pytest pytest-asyncio setuptools wheel +isort +black +pyright