Skip to content

Commit

Permalink
Update Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Feb 2, 2024
1 parent e130d0d commit db2b167
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ ci:

repos:
- repo: https://github.com/psf/black
rev: 24.1.0
rev: 24.1.1
hooks:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
rev: v0.2.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/fastapi/simple_fastapi_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class Database:
@classmethod
async def connect(cls, db_url: str) -> Database:
...
# ...
return Database()

async def get_user(self, user_id: int) -> dict[str, str]:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/starlette/simple_starlette_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class Database:
@classmethod
async def connect(cls, db_url: str) -> Database:
...
# ...
return Database()

async def get_user(self, user_id: int) -> dict[str, str]:
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ line-length = 79

[tool.ruff]
src = ["src", "tests", "conftest.py", "docs"]

[tool.ruff.lint]
select = ["ALL"]
ignore = [
"A001", # shadowing is fine
Expand All @@ -222,7 +224,7 @@ ignore = [
"TCH", # TYPE_CHECKING blocks break autodocs
]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"**/test_*" = [
"S101", # assert
"SIM300", # Yoda rocks in asserts
Expand All @@ -242,7 +244,7 @@ ignore = [

"docs/examples/*" = ["PERF203", "BLE001"]

[tool.ruff.isort]
[tool.ruff.lint.isort]
lines-between-types = 1
lines-after-imports = 2
known-first-party = [
Expand Down

0 comments on commit db2b167

Please sign in to comment.