Skip to content

Fix typos #17988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/ruff_formatter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`].
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -234,18 +234,18 @@ 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 |
152 151 | def f():

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
Expand All @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_python_ast/src/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_python_ast/src/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_python_ast/src/visitor/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Loading
Loading