mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-19 12:16:43 +00:00
[ty] Document when a rule was added (#20859)
This commit is contained in:
parent
6341bb7403
commit
441ba20876
6 changed files with 485 additions and 304 deletions
|
|
@ -93,14 +93,39 @@ fn generate_markdown() -> String {
|
|||
})
|
||||
.join("\n");
|
||||
|
||||
let status_text = match lint.status() {
|
||||
ty_python_semantic::lint::LintStatus::Stable { since } => {
|
||||
format!(
|
||||
r#"Added in <a href="https://github.com/astral-sh/ty/releases/tag/{since}">{since}</a>"#
|
||||
)
|
||||
}
|
||||
ty_python_semantic::lint::LintStatus::Preview { since } => {
|
||||
format!(
|
||||
r#"Preview (since <a href="https://github.com/astral-sh/ty/releases/tag/{since}">{since}</a>)"#
|
||||
)
|
||||
}
|
||||
ty_python_semantic::lint::LintStatus::Deprecated { since, .. } => {
|
||||
format!(
|
||||
r#"Deprecated (since <a href="https://github.com/astral-sh/ty/releases/tag/{since}">{since}</a>)"#
|
||||
)
|
||||
}
|
||||
ty_python_semantic::lint::LintStatus::Removed { since, .. } => {
|
||||
format!(
|
||||
r#"Removed (since <a href="https://github.com/astral-sh/ty/releases/tag/{since}">{since}</a>)"#
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
let _ = writeln!(
|
||||
&mut output,
|
||||
r#"<small>
|
||||
Default level: [`{level}`](../rules.md#rule-levels "This lint has a default level of '{level}'.") ·
|
||||
[Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20{encoded_name}) ·
|
||||
[View source](https://github.com/astral-sh/ruff/blob/main/{file}#L{line})
|
||||
Default level: <a href="../rules.md#rule-levels" title="This lint has a default level of '{level}'."><code>{level}</code></a> ·
|
||||
{status_text} ·
|
||||
<a href="https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20{encoded_name}" target="_blank">Related issues</a> ·
|
||||
<a href="https://github.com/astral-sh/ruff/blob/main/{file}#L{line}" target="_blank">View source</a>
|
||||
</small>
|
||||
|
||||
|
||||
{documentation}
|
||||
"#,
|
||||
level = lint.default_level(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue