diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 624a2f0..a0a62fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,3 +38,27 @@ jobs: run: tox env: PLATFORM: ${{ matrix.platform }} + + lint: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - uses: actions/checkout@v3 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install poetry tox tox-gh-actions + + - name: Check formatting with `black` + run: tox -e black -- . + + - name: Check imports with `isort` + run: tox -e isort -- . diff --git a/pyproject.toml b/pyproject.toml index f1ef0c6..553ddf2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,12 @@ [tool.black] line-length = 100 -skip-string-normalization = true -target_version = ['py38'] +target_version = ['py311'] include = '.*\.pyi?$' +[tool.isort] +profile = "black" +skip_gitignore = true + [tool.poetry] name = "pymidi" version = "0.6.0-pre1" diff --git a/tox.ini b/tox.ini index c3afbdc..358c01a 100644 --- a/tox.ini +++ b/tox.ini @@ -38,13 +38,13 @@ usedevelop = True [testenv:black] commands = - black -l 99 -t py311 --check --diff {posargs} + black -l 100 -t py311 --check --diff {posargs} deps = black [testenv:black-fix] commands = - black -l 99 -t py311 . + black -l 100 -t py311 . deps = black @@ -56,7 +56,7 @@ deps = [testenv:isort] commands = - isort --check-only --diff src tests + isort --check-only --diff . deps = isort