Skip to content

Commit

Permalink
Bump dev packages, fix new linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dosisod committed Feb 2, 2024
1 parent dbe3126 commit 6cc9a02
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
16 changes: 8 additions & 8 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
black==23.12.1
black==24.1.1
click==8.1.7
colorama==0.4.6
coverage==7.4.0
coverage==7.4.1
fastapi==0.100.0
iniconfig==2.0.0
isort==5.13.2
mypy-extensions==1.0.0
mypy==1.8.0
packaging==23.1
packaging==23.2
pathspec==0.12.1
platformdirs==4.1.0
pluggy==1.3.0
platformdirs==4.2.0
pluggy==1.4.0
pytest-cov==4.1.0
pytest==7.4.4
ruff==0.1.14
typos==1.17.2
pytest==8.0.0
ruff==0.2.0
typos==1.18.0
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,18 @@ testpaths = ["test"]
line-length = 99
preview = true

select = ["ALL"]
lint.select = ["ALL"]

# TODO: fix RUF100 not playing well with refurb
extend-ignore = [
lint.extend-ignore = [
"A001", "A002", "A003",
"ANN101", "ANN102", "ANN401", "ARG001",
"B905",
"C901",
"COM812",
"D100", "D101", "D102", "D103", "D104", "D105", "D107", "D200", "D202", "D203",
"D205", "D212", "D214", "D400", "D401", "D404", "D405", "D406", "D407", "D412",
"D415", "D416",
"D413", "D415", "D416",
"EM101", "EM102",
"F821",
"FBT001",
Expand Down Expand Up @@ -119,7 +119,7 @@ extend-exclude = ["test/data*"]

target-version = "py310"

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"test/*" = ["ANN201", "ARG001", "E501", "TCH001", "TCH002"]
"refurb/*" = ["PT"]
"refurb/main.py" = ["E501"]
Expand Down
4 changes: 2 additions & 2 deletions refurb/checks/flow/no_trailing_continue.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ def get_trailing_continue(node: Statement) -> Generator[Statement, None, None]:

yield from get_trailing_continue(body.body[-1])

case (IfStmt(else_body=Block(body=[*_, stmt])) | WithStmt(body=Block(body=[*_, stmt]))):
case IfStmt(else_body=Block(body=[*_, stmt])) | WithStmt(body=Block(body=[*_, stmt])):
yield from get_trailing_continue(stmt)

return None


def check(node: ForStmt | WhileStmt, errors: list[Error]) -> None:
match node:
case (ForStmt(body=Block(body=[*prev, stmt])) | WhileStmt(body=Block(body=[*prev, stmt]))):
case ForStmt(body=Block(body=[*prev, stmt])) | WhileStmt(body=Block(body=[*prev, stmt])):
if not prev and isinstance(stmt, ContinueStmt):
return

Expand Down
2 changes: 1 addition & 1 deletion refurb/checks/flow/no_trailing_return.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_trailing_return(node: Statement) -> Generator[Statement, None, None]:

yield from get_trailing_return(body.body[-1])

case (IfStmt(else_body=Block(body=[*_, stmt])) | WithStmt(body=Block(body=[*_, stmt]))):
case IfStmt(else_body=Block(body=[*_, stmt])) | WithStmt(body=Block(body=[*_, stmt])):
yield from get_trailing_return(stmt)

return None
Expand Down
4 changes: 2 additions & 2 deletions refurb/checks/readability/no_len_cmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ def check_condition_like(
if guard:
visitor.accept(guard)

case (GeneratorExpr(condlists=conditions) | DictionaryComprehension(condlists=conditions)):
case GeneratorExpr(condlists=conditions) | DictionaryComprehension(condlists=conditions):
for condition in conditions:
for expr in condition:
visitor.accept(expr)

case (ConditionalExpr(cond=expr) | WhileStmt(expr=expr) | AssertStmt(expr=expr)):
case ConditionalExpr(cond=expr) | WhileStmt(expr=expr) | AssertStmt(expr=expr):
visitor.accept(expr)
1 change: 1 addition & 0 deletions test/mypy_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
6. Restore the native mypy implementations
"""

import inspect
import sys
import typing
Expand Down

0 comments on commit 6cc9a02

Please sign in to comment.