diff --git a/docs/configuration.md b/docs/configuration.md index 834587e3ad..7f20a6dc5c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -8,9 +8,7 @@ Specifically, ty will search for a `pyproject.toml` or `ty.toml` file in the cur If a `pyproject.toml` file is found, ty will read configuration from the `[tool.ty]` table. For example, to ignore the `index-out-of-bounds` rule, add the following to a `pyproject.toml`: -**`pyproject.toml`**: - -```toml +```toml title="pyproject.toml" [tool.ty.rules] index-out-of-bounds = "ignore" ``` @@ -19,9 +17,7 @@ index-out-of-bounds = "ignore" ty will also search for `ty.toml` files, which follow an identical structure, but omit the `[tool.ty]` prefix. For example: -**`ty.toml`**: - -```toml +```toml title="ty.toml" [rules] index-out-of-bounds = "ignore" ``` diff --git a/docs/exclusions.md b/docs/exclusions.md index 75e98b3338..5df9229ffa 100644 --- a/docs/exclusions.md +++ b/docs/exclusions.md @@ -4,7 +4,7 @@ ty automatically discovers all Python files in your project. You can customize w For example, with the following configuration, ty checks all Python files in the `src` and `tests` directories except those in the `src/generated` directory: -```toml +```toml title="pyproject.toml" [tool.ty.src] include = ["src", "tests"] exclude = ["src/generated"] @@ -12,7 +12,7 @@ exclude = ["src/generated"] By default, ty excludes a [variety of commonly ignored directories](./reference/configuration.md#exclude). If you want to include one of these directories, you can do so by adding a negative `exclude`: -```toml +```toml title="pyproject.toml" [tool.ty.src] # Remove `build` from the excluded directories. exclude = ["!**/build/"] diff --git a/docs/modules.md b/docs/modules.md index a9e33ab121..7fa7ac0719 100644 --- a/docs/modules.md +++ b/docs/modules.md @@ -22,7 +22,7 @@ example-pkg then set [`environment.root`](./reference/configuration.md#root) in your `pyproject.toml` to `["./app"]`: -```toml +```toml title="pyproject.toml" [tool.ty.environment] root = ["./app"] ``` diff --git a/docs/rules.md b/docs/rules.md index f067a4391a..7fc56e824a 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -35,7 +35,7 @@ Rule levels can also be changed in the [`rules`](./reference/configuration.md#ru For example, the following is equivalent to the command above: -```toml +```toml title="pyproject.toml" [tool.ty.rules] unused-ignore-comment = "warn" redundant-cast = "ignore"