mirror of https://github.com/astral-sh/ruff
[ty] Rename `types::liskov` to `types::overrides` (#21694)
This commit is contained in:
parent
d40590c8f9
commit
69ace00210
|
|
@ -96,11 +96,11 @@ mod generics;
|
|||
pub mod ide_support;
|
||||
mod infer;
|
||||
mod instance;
|
||||
mod liskov;
|
||||
mod member;
|
||||
mod mro;
|
||||
mod narrow;
|
||||
mod newtype;
|
||||
mod overrides;
|
||||
mod protocol_class;
|
||||
mod signatures;
|
||||
mod special_form;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use crate::types::class::{
|
|||
CodeGeneratorKind, DisjointBase, DisjointBaseKind, Field, MethodDecorator,
|
||||
};
|
||||
use crate::types::function::{FunctionDecorators, FunctionType, KnownFunction, OverloadLiteral};
|
||||
use crate::types::liskov::MethodKind;
|
||||
use crate::types::overrides::MethodKind;
|
||||
use crate::types::string_annotation::{
|
||||
BYTE_STRING_TYPE_ANNOTATION, ESCAPE_CHARACTER_IN_FORWARD_ANNOTATION, FSTRING_TYPE_ANNOTATION,
|
||||
IMPLICIT_CONCATENATED_STRING_TYPE_ANNOTATION, INVALID_SYNTAX_IN_FORWARD_ANNOTATION,
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ use crate::types::{
|
|||
Truthiness, Type, TypeAliasType, TypeAndQualifiers, TypeContext, TypeQualifiers,
|
||||
TypeVarBoundOrConstraints, TypeVarBoundOrConstraintsEvaluation, TypeVarDefaultEvaluation,
|
||||
TypeVarIdentity, TypeVarInstance, TypeVarKind, TypeVarVariance, TypedDictType, UnionBuilder,
|
||||
UnionType, UnionTypeInstance, binding_type, infer_scope_types, liskov, todo_type,
|
||||
UnionType, UnionTypeInstance, binding_type, infer_scope_types, overrides, todo_type,
|
||||
};
|
||||
use crate::types::{ClassBase, add_inferred_python_version_hint_to_diagnostic};
|
||||
use crate::unpack::{EvaluationMode, UnpackPosition};
|
||||
|
|
@ -972,8 +972,9 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
|
|||
}
|
||||
}
|
||||
|
||||
// (8) Check for Liskov violations
|
||||
liskov::check_class(&self.context, class);
|
||||
// (8) Check for violations of the Liskov Substitution Principle,
|
||||
// and for violations of other rules relating to invalid overrides of some sort.
|
||||
overrides::check_class(&self.context, class);
|
||||
|
||||
if let Some(protocol) = class.into_protocol_class(self.db()) {
|
||||
protocol.validate_members(&self.context);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
//! Checks relating to the [Liskov Substitution Principle].
|
||||
//! Checks relating to invalid method overrides in subclasses,
|
||||
//! including (but not limited to) violations of the [Liskov Substitution Principle].
|
||||
//!
|
||||
//! [Liskov Substitution Principle]: https://en.wikipedia.org/wiki/Liskov_substitution_principle
|
||||
|
||||
Loading…
Reference in New Issue