[ruff] Fix minor typos in doc comments (#20623)

This commit is contained in:
Takayuki Maeda 2025-09-29 15:56:23 +09:00 committed by GitHub
parent 65e805de62
commit 666f53331f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 8 additions and 8 deletions

View file

@ -444,7 +444,7 @@ fn benchmark_complex_constrained_attributes_2(criterion: &mut Criterion) {
criterion.bench_function("ty_micro[complex_constrained_attributes_2]", |b| {
b.iter_batched_ref(
|| {
// This is is similar to the case above, but now the attributes are actually defined.
// This is similar to the case above, but now the attributes are actually defined.
// https://github.com/astral-sh/ty/issues/711
setup_micro_case(
r#"

View file

@ -2360,7 +2360,7 @@ impl<'a> Checker<'a> {
}
}
/// Visit an body of [`Stmt`] nodes within a type-checking block.
/// Visit a body of [`Stmt`] nodes within a type-checking block.
fn visit_type_checking_block(&mut self, body: &'a [Stmt]) {
let snapshot = self.semantic.flags;
self.semantic.flags |= SemanticModelFlags::TYPE_CHECKING_BLOCK;

View file

@ -2101,7 +2101,7 @@ impl<'a> SemanticModel<'a> {
/// Finds and returns the [`Scope`] corresponding to a given [`ast::StmtFunctionDef`].
///
/// This method searches all scopes created by a function definition, comparing the
/// [`TextRange`] of the provided `function_def` with the the range of the function
/// [`TextRange`] of the provided `function_def` with the range of the function
/// associated with the scope.
pub fn function_scope(&self, function_def: &ast::StmtFunctionDef) -> Option<&Scope<'_>> {
self.scopes.iter().find(|scope| {

View file

@ -688,7 +688,7 @@ fn import_from_tokens(tokens: &[Token]) -> Option<&Token> {
/// This also handles cases like `import foo, c<CURSOR>, bar`.
///
/// If found, a token corresponding to the `import` or `from` keyword
/// and the the closest point of the `<CURSOR>` is returned.
/// and the closest point of the `<CURSOR>` is returned.
///
/// It is assumed that callers will call `from_import_tokens` first to
/// try and recognize a `from ... import ...` statement before using

View file

@ -123,7 +123,7 @@ impl<'a> Importer<'a> {
/// then the existing style is always respected instead.
///
/// `members` should be a map of symbols in scope at the position
/// where the the imported symbol should be available. This is used
/// where the imported symbol should be available. This is used
/// to craft import statements in a way that doesn't conflict with
/// symbols in scope. If it's not feasible to provide this map, then
/// providing an empty map is generally fine. But it does mean that

View file

@ -10,7 +10,7 @@ mod exclude;
mod include;
mod portable;
/// Path filtering based on an an exclude and include glob pattern set.
/// Path filtering based on an exclude and include glob pattern set.
///
/// Exclude patterns take precedence over includes.
#[derive(Clone, Debug, Eq, PartialEq, get_size2::GetSize)]

View file

@ -2272,7 +2272,7 @@ impl<'ast> Visitor<'ast> for SemanticIndexBuilder<'_, 'ast> {
// like `sys.exit()`, and not within sub-expression like `3 + sys.exit()` etc.
//
// We also only add these inside function scopes, since considering module-level
// constraints can affect the the type of imported symbols, leading to a lot more
// constraints can affect the type of imported symbols, leading to a lot more
// work in third-party code.
if let ast::Expr::Call(ast::ExprCall { func, .. }) = value.as_ref() {
if !self.source_type.is_stub() && self.in_function_scope() {

View file

@ -3152,7 +3152,7 @@ impl<'db> Type<'db> {
);
match self {
Type::Callable(callable) if callable.is_function_like(db) => {
// For "function-like" callables, model the the behavior of `FunctionType.__get__`.
// For "function-like" callables, model the behavior of `FunctionType.__get__`.
//
// It is a shortcut to model this in `try_call_dunder_get`. If we want to be really precise,
// we should instead return a new method-wrapper type variant for the synthesized `__get__`