[red-knot] Add --ignore, --warn, and --error CLI arguments (#15689)

This commit is contained in:
Micha Reiser 2025-01-24 16:20:15 +01:00 committed by GitHub
parent ab2e1905c4
commit 4e3982cf95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 396 additions and 83 deletions

View file

@ -94,6 +94,10 @@ impl DiagnosticId {
matches!(self, DiagnosticId::Lint(self_name) if self_name == name)
}
pub fn strip_category(code: &str) -> Option<&str> {
code.split_once(':').map(|(_, rest)| rest)
}
/// Returns `true` if this `DiagnosticId` matches the given name.
///
/// ## Examples