mirror of
https://github.com/astral-sh/ruff.git
synced 2025-12-23 09:19:39 +00:00
Fix rules section
This commit is contained in:
parent
0909c37e04
commit
5a115146fb
2 changed files with 8 additions and 8 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
2
crates/ty/docs/configuration.md
generated
2
crates/ty/docs/configuration.md
generated
|
|
@ -31,7 +31,7 @@ Valid severities are:
|
|||
=== "ty.toml"
|
||||
|
||||
```toml
|
||||
[tool.ty.rules]
|
||||
[rules]
|
||||
possibly-unresolved-reference = "warn"
|
||||
division-by-zero = "ignore"
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue