Fix rules section

This commit is contained in:
Matthew Mckee 2025-12-22 22:27:50 +00:00 committed by Micha Reiser
parent 0909c37e04
commit 5a115146fb
No known key found for this signature in database
2 changed files with 8 additions and 8 deletions

View file

@ -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 {

View file

@ -31,7 +31,7 @@ Valid severities are:
=== "ty.toml"
```toml
[tool.ty.rules]
[rules]
possibly-unresolved-reference = "warn"
division-by-zero = "ignore"
```