Skip to content

Commit 38b8e4a

Browse files
authored
🔧 Migrate from Black, isort, flake8, autoflake, pyupgrade to Ruff (#763)
1 parent 3eccf5a commit 38b8e4a

243 files changed

Lines changed: 414 additions & 643 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,13 @@ repos:
1313
- --unsafe
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace
16-
- repo: https://github.com/asottile/pyupgrade
17-
rev: v3.15.0
16+
- repo: https://github.com/astral-sh/ruff-pre-commit
17+
rev: v0.2.0
1818
hooks:
19-
- id: pyupgrade
19+
- id: ruff
2020
args:
21-
- --py3-plus
22-
- --keep-runtime-typing
23-
# This file is more readable without yield from
24-
exclude: ^docs_src/progressbar/tutorial004\.py
25-
- repo: https://github.com/PyCQA/autoflake
26-
rev: v2.2.1
27-
hooks:
28-
- id: autoflake
29-
args:
30-
- --recursive
31-
- --in-place
32-
- --remove-all-unused-imports
33-
- --remove-unused-variables
34-
- --expand-star-imports
35-
- --exclude
36-
- __init__.py
37-
- --remove-duplicate-keys
38-
- repo: https://github.com/pycqa/isort
39-
rev: 5.12.0
40-
hooks:
41-
- id: isort
42-
name: isort (python)
43-
- id: isort
44-
name: isort (cython)
45-
types: [cython]
46-
- id: isort
47-
name: isort (pyi)
48-
types: [pyi]
49-
- repo: https://github.com/psf/black
50-
rev: 23.10.0
51-
hooks:
52-
- id: black
21+
- --fix
22+
- id: ruff-format
5323
ci:
5424
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
5525
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate

docs_src/arguments/envvar/tutorial002_an.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
def main(
6-
name: Annotated[str, typer.Argument(envvar=["AWESOME_NAME", "GOD_NAME"])] = "World"
6+
name: Annotated[str, typer.Argument(envvar=["AWESOME_NAME", "GOD_NAME"])] = "World",
77
):
88
print(f"Hello Mr. {name}")
99

docs_src/arguments/envvar/tutorial003_an.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def main(
66
name: Annotated[
77
str, typer.Argument(envvar="AWESOME_NAME", show_envvar=False)
8-
] = "World"
8+
] = "World",
99
):
1010
print(f"Hello Mr. {name}")
1111

docs_src/arguments/help/tutorial004_an.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def main(
66
name: Annotated[
77
str, typer.Argument(help="Who to greet", show_default=False)
8-
] = "World"
8+
] = "World",
99
):
1010
"""
1111
Say hi to NAME very gently, like Dirk.

docs_src/arguments/help/tutorial005.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
def main(
55
name: str = typer.Argument(
66
"Wade Wilson", help="Who to greet", show_default="Deadpoolio the amazing's name"
7-
)
7+
),
88
):
99
print(f"Hello {name}")
1010

docs_src/arguments/help/tutorial005_an.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def main(
88
typer.Argument(
99
help="Who to greet", show_default="Deadpoolio the amazing's name"
1010
),
11-
] = "Wade Wilson"
11+
] = "Wade Wilson",
1212
):
1313
print(f"Hello {name}")
1414

docs_src/commands/help/tutorial001.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def delete_all(
3737
...,
3838
prompt="Are you sure you want to delete ALL users?",
3939
help="Force deletion without confirmation.",
40-
)
40+
),
4141
):
4242
"""
4343
Delete ALL users in the database.

docs_src/commands/help/tutorial001_an.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def delete_all(
4242
prompt="Are you sure you want to delete ALL users?",
4343
help="Force deletion without confirmation.",
4444
),
45-
]
45+
],
4646
):
4747
"""
4848
Delete ALL users in the database.

docs_src/commands/help/tutorial004.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
def create(
88
username: str = typer.Argument(
99
..., help="The username to be [green]created[/green]"
10-
)
10+
),
1111
):
1212
"""
1313
[bold green]Create[/bold green] a new [italic]shiny[/italic] user. :sparkles:

docs_src/commands/help/tutorial004_an.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def create(
99
username: Annotated[
1010
str, typer.Argument(help="The username to be [green]created[/green]")
11-
]
11+
],
1212
):
1313
"""
1414
[bold green]Create[/bold green] a new [italic]shinny[/italic] user. :sparkles:

0 commit comments

Comments
 (0)