type: ignore[codes] and knot: ignore (#15078)

This commit is contained in:
Micha Reiser 2024-12-23 10:52:43 +01:00 committed by GitHub
parent 9eb73cb7e0
commit 2f85749fa0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 737 additions and 48 deletions

View file

@ -33,11 +33,15 @@ mod visibility_constraints;
type FxOrderSet<V> = ordermap::set::OrderSet<V, BuildHasherDefault<FxHasher>>;
/// Creates a new registry with all known semantic lints.
pub fn default_lint_registry() -> LintRegistry {
let mut registry = LintRegistryBuilder::default();
register_lints(&mut registry);
registry.build()
/// Returns the default registry with all known semantic lints.
pub fn default_lint_registry() -> &'static LintRegistry {
static REGISTRY: std::sync::LazyLock<LintRegistry> = std::sync::LazyLock::new(|| {
let mut registry = LintRegistryBuilder::default();
register_lints(&mut registry);
registry.build()
});
&REGISTRY
}
/// Register all known semantic lints.