Fix typos

---------

Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
This commit is contained in:
omahs 2025-05-09 20:57:14 +02:00 committed by GitHub
parent b4a1ebdfe3
commit 882a1a702e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 191 additions and 191 deletions

View file

@ -92,7 +92,7 @@ impl std::fmt::Display for IndentStyle {
}
}
/// The visual width of a indentation.
/// The visual width of an indentation.
///
/// Determines the visual width of a tab character (`\t`) and the number of
/// spaces per indent when using [`IndentStyle::Space`].
@ -207,7 +207,7 @@ pub trait FormatOptions {
/// What's the max width of a line. Defaults to 80.
fn line_width(&self) -> LineWidth;
/// Derives the print options from the these format options
/// Derives the print options from these format options
fn as_print_options(&self) -> PrinterOptions;
}

View file

@ -144,14 +144,14 @@ def f():
def f():
# make sure that `tmp` is not deleted
tmp = 1; result = [] # commment should be protected
tmp = 1; result = [] # comment should be protected
for i in range(10):
result.append(i + 1) # PERF401
def f():
# make sure that `tmp` is not deleted
result = []; tmp = 1 # commment should be protected
result = []; tmp = 1 # comment should be protected
for i in range(10):
result.append(i + 1) # PERF401

View file

@ -93,7 +93,7 @@ PERF401.py:142:9: PERF401 Use a list comprehension to create a transformed list
PERF401.py:149:9: PERF401 Use a list comprehension to create a transformed list
|
147 | tmp = 1; result = [] # commment should be protected
147 | tmp = 1; result = [] # comment should be protected
148 | for i in range(10):
149 | result.append(i + 1) # PERF401
| ^^^^^^^^^^^^^^^^^^^^ PERF401
@ -102,7 +102,7 @@ PERF401.py:149:9: PERF401 Use a list comprehension to create a transformed list
PERF401.py:156:9: PERF401 Use a list comprehension to create a transformed list
|
154 | result = []; tmp = 1 # commment should be protected
154 | result = []; tmp = 1 # comment should be protected
155 | for i in range(10):
156 | result.append(i + 1) # PERF401
| ^^^^^^^^^^^^^^^^^^^^ PERF401

View file

@ -223,7 +223,7 @@ PERF401.py:142:9: PERF401 [*] Use a list comprehension to create a transformed l
PERF401.py:149:9: PERF401 [*] Use a list comprehension to create a transformed list
|
147 | tmp = 1; result = [] # commment should be protected
147 | tmp = 1; result = [] # comment should be protected
148 | for i in range(10):
149 | result.append(i + 1) # PERF401
| ^^^^^^^^^^^^^^^^^^^^ PERF401
@ -234,10 +234,10 @@ PERF401.py:149:9: PERF401 [*] Use a list comprehension to create a transformed l
144 144 |
145 145 | def f():
146 146 | # make sure that `tmp` is not deleted
147 |- tmp = 1; result = [] # commment should be protected
147 |- tmp = 1; result = [] # comment should be protected
148 |- for i in range(10):
149 |- result.append(i + 1) # PERF401
147 |+ tmp = 1 # commment should be protected
147 |+ tmp = 1 # comment should be protected
148 |+ result = [i + 1 for i in range(10)] # PERF401
150 149 |
151 150 |
@ -245,7 +245,7 @@ PERF401.py:149:9: PERF401 [*] Use a list comprehension to create a transformed l
PERF401.py:156:9: PERF401 [*] Use a list comprehension to create a transformed list
|
154 | result = []; tmp = 1 # commment should be protected
154 | result = []; tmp = 1 # comment should be protected
155 | for i in range(10):
156 | result.append(i + 1) # PERF401
| ^^^^^^^^^^^^^^^^^^^^ PERF401
@ -256,10 +256,10 @@ PERF401.py:156:9: PERF401 [*] Use a list comprehension to create a transformed l
151 151 |
152 152 | def f():
153 153 | # make sure that `tmp` is not deleted
154 |- result = []; tmp = 1 # commment should be protected
154 |- result = []; tmp = 1 # comment should be protected
155 |- for i in range(10):
156 |- result.append(i + 1) # PERF401
154 |+ tmp = 1 # commment should be protected
154 |+ tmp = 1 # comment should be protected
155 |+ result = [i + 1 for i in range(10)] # PERF401
157 156 |
158 157 |

View file

@ -2844,7 +2844,7 @@ impl Arguments {
self.find_argument(name, position).map(ArgOrKeyword::value)
}
/// Return the the argument with the given name or at the given position, or `None` if no such
/// Return the argument with the given name or at the given position, or `None` if no such
/// argument exists. Used to retrieve arguments that can be provided _either_ as keyword or
/// positional arguments.
pub fn find_argument(&self, name: &str, position: usize) -> Option<ArgOrKeyword> {

View file

@ -590,7 +590,7 @@ pub fn walk_except_handler<'a, V: Visitor<'a> + ?Sized>(
}
pub fn walk_arguments<'a, V: Visitor<'a> + ?Sized>(visitor: &mut V, arguments: &'a Arguments) {
// Note that the there might be keywords before the last arg, e.g. in
// Note that there might be keywords before the last arg, e.g. in
// f(*args, a=2, *args2, **kwargs)`, but we follow Python in evaluating first `args` and then
// `keywords`. See also [Arguments::arguments_source_order`].
for arg in &*arguments.args {

View file

@ -576,7 +576,7 @@ pub fn walk_except_handler<V: Transformer + ?Sized>(
}
pub fn walk_arguments<V: Transformer + ?Sized>(visitor: &V, arguments: &mut Arguments) {
// Note that the there might be keywords before the last arg, e.g. in
// Note that there might be keywords before the last arg, e.g. in
// f(*args, a=2, *args2, **kwargs)`, but we follow Python in evaluating first `args` and then
// `keywords`. See also [Arguments::arguments_source_order`].
for arg in &mut *arguments.args {

View file

@ -1,5 +1,5 @@
# For tuple expression, the minimum binding power of star expression is bitwise or.
# Test the first and any other element as the there are two separate calls.
# Test the first and any other element as there are two separate calls.
(*x in y, z, *x in y)
(*not x, z, *not x)

View file

@ -1389,7 +1389,7 @@ X: bool = True
```py
def f():
# TODO: we should emit a syntax errror here (tracked by https://github.com/astral-sh/ruff/issues/11934)
# TODO: we should emit a syntax error here (tracked by https://github.com/astral-sh/ruff/issues/17412)
from exporter import *
# error: [unresolved-reference]

View file

@ -163,7 +163,7 @@ other
## Based on type inference
For the the rest of this test suite, we will mostly use `True` and `False` literals to indicate
For the rest of this test suite, we will mostly use `True` and `False` literals to indicate
statically known conditions, but here, we show that the results are truly based on type inference,
not some special handling of specific conditions in semantic index building. We use two modules to
demonstrate this, since semantic index building is inherently single-module:

View file

@ -1824,7 +1824,7 @@ where
// Save the state immediately *after* visiting the `try` block
// but *before* we prepare for visiting the `except` block(s).
//
// We will revert to this state prior to visiting the the `else` block,
// We will revert to this state prior to visiting the `else` block,
// as there necessarily must have been 0 `except` blocks executed
// if we hit the `else` block.
let post_try_block_state = self.flow_snapshot();

View file

@ -9,7 +9,7 @@ pub(crate) struct CallArguments<'a>(Vec<Argument<'a>>);
impl<'a> CallArguments<'a> {
/// Prepend an optional extra synthetic argument (for a `self` or `cls` parameter) to the front
/// of this argument list. (If `bound_self` is none, we return the the argument list
/// of this argument list. (If `bound_self` is none, we return the argument list
/// unmodified.)
pub(crate) fn with_self(&self, bound_self: Option<Type<'_>>) -> Cow<Self> {
if bound_self.is_some() {
@ -87,7 +87,7 @@ impl<'a, 'db> CallArgumentTypes<'a, 'db> {
}
/// Prepend an optional extra synthetic argument (for a `self` or `cls` parameter) to the front
/// of this argument list. (If `bound_self` is none, we return the the argument list
/// of this argument list. (If `bound_self` is none, we return the argument list
/// unmodified.)
pub(crate) fn with_self(&self, bound_self: Option<Type<'db>>) -> Cow<Self> {
if let Some(bound_self) = bound_self {

View file

@ -492,7 +492,7 @@ impl std::ops::DerefMut for DiagnosticGuard<'_, '_> {
///
/// # Panics
///
/// This panics when the the underlying diagnostic lacks a primary
/// This panics when the underlying diagnostic lacks a primary
/// annotation, or if it has one and its file doesn't match the file
/// being type checked.
impl Drop for DiagnosticGuard<'_, '_> {

View file

@ -8277,7 +8277,7 @@ impl<'db> TypeInferenceBuilder<'db> {
let callable_type = Type::Callable(callable_type);
// `Signature` / `Parameters` are not a `Type` variant, so we're storing
// the outer callable type on the these expressions instead.
// the outer callable type on these expressions instead.
self.store_expression_type(arguments_slice, callable_type);
if let Some(first_argument) = first_argument {
self.store_expression_type(first_argument, callable_type);