Skip to content

Commit fa959ed

Browse files
committedFeb 16, 2024·
build: 🛠 Switch to pyright + basic project cleanup
1 parent 7f77880 commit fa959ed

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed
 

‎.github/workflows/lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "LINT: Run ruff & mypy"
1+
name: "LINT: Run ruff & pyright"
22
on:
33
push:
44
pull_request:
@@ -17,7 +17,7 @@ jobs:
1717
run: |
1818
python -m pip install --upgrade poetry
1919
poetry install
20-
- name: Lint with ruff & mypy
20+
- name: Lint with ruff & pyright
2121
run: |
2222
poetry run ruff check fastapi_module_loader tests
23-
poetry run mypy fastapi_module_loader
23+
poetry run pyright fastapi_module_loader

‎.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v4.5.0
44
hooks:
55
- id: end-of-file-fixer
66
- id: check-added-large-files
77
- id: check-merge-conflict
88
- id: check-docstring-first
99
- id: debug-statements
1010
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.0.291
11+
rev: v0.2.1
1212
hooks:
1313
- id: ruff
1414
args: [--fix, --exit-non-zero-on-fix]
1515
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
16-
rev: v1.3.2
16+
rev: v1.3.3
1717
hooks:
1818
- id: python-safety-dependencies-check
1919
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
20-
rev: v9.5.0
20+
rev: v9.11.0
2121
hooks:
2222
- id: commitlint
2323
stages: [commit-msg]

‎justfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ test-all: (poetry "run" "tox")
3232

3333
ruff *args: (poetry "run" "ruff" "check" "fastapi_module_loader" "tests" args)
3434

35-
mypy *args: (poetry "run" "mypy" "fastapi_module_loader" args)
35+
pyright *args: (poetry "run" "pyright" "fastapi_module_loader" args)
3636

37-
lint: ruff mypy
37+
lint: ruff pyright
3838

3939
publish: (poetry "publish" "--build")

‎pyproject.toml

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,21 @@ fastapi = ">=0.65.2,<1.0.0"
1414
[tool.poetry.group.dev.dependencies]
1515
pytest = ">=7.1.2,<9.0.0"
1616
pytest-cov = ">=3,<5"
17-
mypy = ">=0.971,<2.0"
1817
tox = ">=3.26,<5.0"
1918
httpx = ">=0.24.1,<1.0.0"
2019
ruff = ">=0.0.284,<0.3.0"
20+
pyright = ">=1.1.350,<1.2"
2121

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

29-
[tool.ruff.per-file-ignores]
27+
[tool.ruff.lint]
28+
select = ["F","E","W","C","I","N","UP","ANN","S","B","A","COM","C4","T20","PT","ARG","TD","RUF"]
29+
ignore = ["A001","A002","A003","ANN101","ANN102","ANN401","C901","N8","B008","F405","F821"]
30+
31+
[tool.ruff.lint.per-file-ignores]
3032
"__init__.py" = ["F401"]
3133
"conftest.py" = ["S101","ANN","F401"]
3234
"test_*.py" = ["S101","ANN","F401","ARG001"]

0 commit comments

Comments
 (0)
Please sign in to comment.