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
8 changes: 2 additions & 6 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
Expand All @@ -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"
```
Expand Down
4 changes: 2 additions & 2 deletions docs/exclusions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ 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"]
```

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/"]
Expand Down
2 changes: 1 addition & 1 deletion docs/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
```
Expand Down
2 changes: 1 addition & 1 deletion docs/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down