Skip to content

Commit f904338

Browse files
committed
Apply ruff's suggestions
1 parent 650e283 commit f904338

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎typer/.agents/skills/typer/SKILL.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ An older way of setting a default value is this:
106106
```python
107107
# DO NOT DO THIS: old style. Use Annotated instead.
108108

109+
109110
@app.command()
110111
def main(name: str = typer.Argument(default="World")):
111112
# Note that name is an optional Argument, as a default is provided
@@ -117,6 +118,7 @@ Similarly, the old style could use ellipsis (...) to explicitly mark an argument
117118
```python
118119
# DO NOT DO THIS: old style. Use Annotated without a default value instead.
119120

121+
120122
@app.command()
121123
def main(name: str = typer.Argument(default=...)):
122124
# Note that name is now a required Argument
@@ -269,12 +271,16 @@ import typer
269271

270272
app = typer.Typer(rich_markup_mode="markdown")
271273

274+
272275
@app.command(help="**Delete** a user with *username*.")
273276
def delete(
274-
username: Annotated[str, typer.Argument(help="The username to be **deleted** :boom:")]
277+
username: Annotated[
278+
str, typer.Argument(help="The username to be **deleted** :boom:")
279+
],
275280
):
276281
print(f"Deleting user: {username}")
277282

283+
278284
if __name__ == "__main__":
279285
app()
280286
```

0 commit comments

Comments
 (0)