Skip to content

Commit

Permalink
Merge pull request #32 from mik3y/mikey/lint-checks
Browse files Browse the repository at this point in the history
actions: run `black` and `isort`
  • Loading branch information
mik3y authored Aug 26, 2023
2 parents 268a140 + 70c6038 commit e564b92
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -- .
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -56,7 +56,7 @@ deps =

[testenv:isort]
commands =
isort --check-only --diff src tests
isort --check-only --diff .
deps =
isort

Expand Down

0 comments on commit e564b92

Please sign in to comment.