diff --git a/crates/ruff_benchmark/benches/ty.rs b/crates/ruff_benchmark/benches/ty.rs index f1000fb050..9fb13aca01 100644 --- a/crates/ruff_benchmark/benches/ty.rs +++ b/crates/ruff_benchmark/benches/ty.rs @@ -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#" diff --git a/crates/ruff_linter/src/checkers/ast/mod.rs b/crates/ruff_linter/src/checkers/ast/mod.rs index 961052eebb..1a1f462e8e 100644 --- a/crates/ruff_linter/src/checkers/ast/mod.rs +++ b/crates/ruff_linter/src/checkers/ast/mod.rs @@ -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; diff --git a/crates/ruff_python_semantic/src/model.rs b/crates/ruff_python_semantic/src/model.rs index b8de310a36..4f2dc47162 100644 --- a/crates/ruff_python_semantic/src/model.rs +++ b/crates/ruff_python_semantic/src/model.rs @@ -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| { diff --git a/crates/ty_ide/src/completion.rs b/crates/ty_ide/src/completion.rs index 24c7f946af..32c3ef02e1 100644 --- a/crates/ty_ide/src/completion.rs +++ b/crates/ty_ide/src/completion.rs @@ -688,7 +688,7 @@ fn import_from_tokens(tokens: &[Token]) -> Option<&Token> { /// This also handles cases like `import foo, c, bar`. /// /// If found, a token corresponding to the `import` or `from` keyword -/// and the the closest point of the `` is returned. +/// and the closest point of the `` is returned. /// /// It is assumed that callers will call `from_import_tokens` first to /// try and recognize a `from ... import ...` statement before using diff --git a/crates/ty_ide/src/importer.rs b/crates/ty_ide/src/importer.rs index bbea834f30..bbc5281ddf 100644 --- a/crates/ty_ide/src/importer.rs +++ b/crates/ty_ide/src/importer.rs @@ -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 diff --git a/crates/ty_project/src/glob.rs b/crates/ty_project/src/glob.rs index 7127f55f41..81842f4948 100644 --- a/crates/ty_project/src/glob.rs +++ b/crates/ty_project/src/glob.rs @@ -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)] diff --git a/crates/ty_python_semantic/src/semantic_index/builder.rs b/crates/ty_python_semantic/src/semantic_index/builder.rs index 3b1792a87f..2cbdea0261 100644 --- a/crates/ty_python_semantic/src/semantic_index/builder.rs +++ b/crates/ty_python_semantic/src/semantic_index/builder.rs @@ -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() { diff --git a/crates/ty_python_semantic/src/types.rs b/crates/ty_python_semantic/src/types.rs index 7b643a168a..7d468058bd 100644 --- a/crates/ty_python_semantic/src/types.rs +++ b/crates/ty_python_semantic/src/types.rs @@ -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__`