From 5a115146fbc56ee6645464772f0a048e0e8d717a Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Mon, 22 Dec 2025 22:27:50 +0000 Subject: [PATCH] Fix rules section --- crates/ruff_dev/src/generate_ty_options.rs | 14 +++++++------- crates/ty/docs/configuration.md | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/ruff_dev/src/generate_ty_options.rs b/crates/ruff_dev/src/generate_ty_options.rs index bf8a5e4c2f..27d4865089 100644 --- a/crates/ruff_dev/src/generate_ty_options.rs +++ b/crates/ruff_dev/src/generate_ty_options.rs @@ -222,6 +222,13 @@ fn format_snippet( .chain(scope) .join("."); + // Some examples show headers which would show up in `pyproject.toml`, + if matches!(configuration, ConfigurationFile::TyToml) { + if example.contains("tool.ty") { + return (String::new(), example.replace("tool.ty.", "")); + } + } + // Ex) `[[tool.ty.xx]]` if example.starts_with(&format!("[[{header}")) { return (String::new(), example.to_string()); @@ -232,13 +239,6 @@ fn format_snippet( return (String::new(), example.to_string()); } - // Some examples show headers which would show up in `pyproject.toml`, - if matches!(configuration, ConfigurationFile::TyToml) { - if example.starts_with("[[tool.ty") || example.starts_with("[tool.ty") { - return (String::new(), example.replace("tool.ty.", "")); - } - } - if header.is_empty() { (String::new(), example.to_string()) } else { diff --git a/crates/ty/docs/configuration.md b/crates/ty/docs/configuration.md index 1da19b4bea..eeffda659b 100644 --- a/crates/ty/docs/configuration.md +++ b/crates/ty/docs/configuration.md @@ -31,7 +31,7 @@ Valid severities are: === "ty.toml" ```toml - [tool.ty.rules] + [rules] possibly-unresolved-reference = "warn" division-by-zero = "ignore" ```