Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repos:
entry: uv run ruff format --force-exclude --exit-non-zero-on-format
require_serial: true
language: unsupported
types: [python]
types_or: [python, markdown]

- id: local-mypy
name: mypy check
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import typer

app = typer.Typer()


@app.command()
def register(
user: Annotated[str, typer.Argument()],
Expand All @@ -18,6 +19,7 @@ def register(
print(f"--age is {age}")
print(f"--score is {score}")


if __name__ == "__main__":
app()
```
Expand Down
6 changes: 2 additions & 4 deletions docs/tutorial/commands/name.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ By default, the command names are generated from the function name.
So, if your function is something like:

```Python
def create(username: str):
...
def create(username: str): ...
```

Then the command name will be `create`.
Expand Down Expand Up @@ -50,7 +49,6 @@ Note that any underscores in the function name will be replaced with dashes.
So if your function is something like:

```Python
def create_user(username: str):
...
def create_user(username: str): ...
```
Then the command name will be `create-user`.
1 change: 1 addition & 0 deletions docs/tutorial/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ In short (very short), you can declare a function with parameters like:
```Python
from typing import Optional


def type_example(name: str, formal: bool = False, intro: Optional[str] = None):
pass
```
Expand Down
2 changes: 2 additions & 0 deletions docs/tutorial/package.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ The `app` in `"rick_portal_gun.main:app"` is the thing to import from the module

```Python
from rick_portal_gun.main import app

app()
```

Expand Down Expand Up @@ -422,6 +423,7 @@ Then in that file you can execute your **Typer** program:

```Python
from .main import app

app()
```

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/parameter-types/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The difference is that these types will give you a Python [file-like object](htt
A "file-like object" is the same type of object returned by `open()` as in:

```Python
with open('file.txt') as f:
with open("file.txt") as f:
# Here f is the file-like object
read_data = f.read()
print(read_data)
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial/progressbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def iterate_user_ids():
for i in range(100):
yield i


for i in iterate_user_ids():
print(i)
```
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ tests = [
"pytest-sugar >=1.0.0",
"pytest-xdist >=3.6.1",
"rich >=12.3.0",
"ruff >=0.15.0",
"ruff >=0.16.0",
"shellingham >=1.3.0",
]

Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading