Skip to content

Commit

Permalink
build: 🛠 Switch to pyright + basic project cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ddanier committed Feb 16, 2024
1 parent e160509 commit 385f6ea
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "LINT: Run ruff & mypy"
name: "LINT: Run ruff & pyright"
on:
push:
pull_request:
Expand All @@ -17,7 +17,7 @@ jobs:
run: |
python -m pip install --upgrade poetry
poetry install
- name: Lint with ruff & mypy
- name: Lint with ruff & pyright
run: |
poetry run ruff check async_signals tests
poetry run mypy async_signals
poetry run pyright async_signals
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-merge-conflict
- id: check-docstring-first
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.291
rev: v0.2.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.3.2
rev: v1.3.3
hooks:
- id: python-safety-dependencies-check
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.5.0
rev: v9.11.0
hooks:
- id: commitlint
stages: [commit-msg]
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ test-all: (poetry "run" "tox")

ruff *args: (poetry "run" "ruff" "check" "async_signals" "tests" args)

mypy *args: (poetry "run" "mypy" "async_signals" args)
pyright *args: (poetry "run" "pyright" "async_signals" args)

lint: ruff mypy
lint: ruff pyright

publish: (poetry "publish" "--build")
12 changes: 7 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,21 @@ python = "^3.8"
pytest = ">=7.1.3,<9.0.0"
pytest-cov = ">=3,<5"
pytest-mock = "^3.8.2"
mypy = ">=0.971,<2.0"
anyio = {extras = ["trio"], version = ">=3.6.1,<5.0.0"}
tox = ">=3.26,<5.0"
ruff = ">=0.0.284,<0.3.0"
ruff = ">=0.2.0,<0.3.0"
pyright = ">=1.1.350,<1.2"

[tool.ruff]
select = ["F","E","W","C","I","N","UP","ANN","S","B","A","COM","C4","T20","PT","ARG","TD","RUF"]
line-length = 115
target-version = "py38"
ignore = ["A001","A002","A003","ANN101","ANN102","ANN401","C901","N8","B008","F405","F821"]
output-format = "grouped"

[tool.ruff.per-file-ignores]
[tool.ruff.lint]
select = ["F","E","W","C","I","N","UP","ANN","S","B","A","COM","C4","T20","PT","ARG","TD","RUF"]
ignore = ["A001","A002","A003","ANN101","ANN102","ANN401","C901","N8","B008","F405","F821"]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"conftest.py" = ["S101","ANN","F401"]
"test_*.py" = ["S101","ANN","F401","ARG001"]
Expand Down

0 comments on commit 385f6ea

Please sign in to comment.