Skip to content

Commit

Permalink
Upgrade Ruff; migrate from U to UP check code (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh authored Dec 4, 2022
1 parent a13429d commit d92e8a0
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ detached = true
dependencies = [
"black>=22.6.0",
"mypy>=0.990",
"ruff>=0.0.132",
"ruff>=0.0.156",
]
[envs.lint.scripts]
typing = "mypy --install-types --non-interactive {args:backend/src/hatchling src/hatch tests}"
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,12 @@ select = [
"F",
"FBT",
"I",
"M",
"N",
"Q",
"RUF",
"S",
"T",
"U",
"UP",
"W",
"YTT",
]
Expand Down
2 changes: 1 addition & 1 deletion src/hatch/template/files_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def __init__(self, template_config: dict, plugin_config: dict):
[tool.ruff]
target-version = "py37"
line-length = 120
select = ["A", "B", "C", "E", "F", "FBT", "I", "M", "N", "Q", "RUF", "S", "T", "U", "W", "YTT"]
select = ["A", "B", "C", "E", "F", "FBT", "I", "N", "Q", "RUF", "S", "T", "UP", "W", "YTT"]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/templates/new/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def get_files(**kwargs):
[tool.ruff]
target-version = "py37"
line-length = 120
select = ["A", "B", "C", "E", "F", "FBT", "I", "M", "N", "Q", "RUF", "S", "T", "U", "W", "YTT"]
select = ["A", "B", "C", "E", "F", "FBT", "I", "N", "Q", "RUF", "S", "T", "UP", "W", "YTT"]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/templates/new/feature_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def {kwargs['package_name']}(ctx: click.Context):
[tool.ruff]
target-version = "py37"
line-length = 120
select = ["A", "B", "C", "E", "F", "FBT", "I", "M", "N", "Q", "RUF", "S", "T", "U", "W", "YTT"]
select = ["A", "B", "C", "E", "F", "FBT", "I", "N", "Q", "RUF", "S", "T", "UP", "W", "YTT"]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/templates/new/feature_no_src_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def get_files(**kwargs):
[tool.ruff]
target-version = "py37"
line-length = 120
select = ["A", "B", "C", "E", "F", "FBT", "I", "M", "N", "Q", "RUF", "S", "T", "U", "W", "YTT"]
select = ["A", "B", "C", "E", "F", "FBT", "I", "N", "Q", "RUF", "S", "T", "UP", "W", "YTT"]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/templates/new/licenses_empty.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def get_files(**kwargs):
[tool.ruff]
target-version = "py37"
line-length = 120
select = ["A", "B", "C", "E", "F", "FBT", "I", "M", "N", "Q", "RUF", "S", "T", "U", "W", "YTT"]
select = ["A", "B", "C", "E", "F", "FBT", "I", "N", "Q", "RUF", "S", "T", "UP", "W", "YTT"]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/templates/new/licenses_multiple.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def get_files(**kwargs):
[tool.ruff]
target-version = "py37"
line-length = 120
select = ["A", "B", "C", "E", "F", "FBT", "I", "M", "N", "Q", "RUF", "S", "T", "U", "W", "YTT"]
select = ["A", "B", "C", "E", "F", "FBT", "I", "N", "Q", "RUF", "S", "T", "UP", "W", "YTT"]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/templates/new/projects_urls_empty.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def get_files(**kwargs):
[tool.ruff]
target-version = "py37"
line-length = 120
select = ["A", "B", "C", "E", "F", "FBT", "I", "M", "N", "Q", "RUF", "S", "T", "U", "W", "YTT"]
select = ["A", "B", "C", "E", "F", "FBT", "I", "N", "Q", "RUF", "S", "T", "UP", "W", "YTT"]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def get_files(**kwargs):
[tool.ruff]
target-version = "py37"
line-length = 120
select = ["A", "B", "C", "E", "F", "FBT", "I", "M", "N", "Q", "RUF", "S", "T", "U", "W", "YTT"]
select = ["A", "B", "C", "E", "F", "FBT", "I", "N", "Q", "RUF", "S", "T", "UP", "W", "YTT"]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
Expand Down

0 comments on commit d92e8a0

Please sign in to comment.