Skip to content

Commit 882a1a7

Browse files
omahsntBre
andauthored
Fix typos (#17988)
Fix typos --------- Co-authored-by: Brent Westbrook <[email protected]> Co-authored-by: Brent Westbrook <[email protected]>
1 parent b4a1ebd commit 882a1a7

File tree

15 files changed

+191
-191
lines changed

15 files changed

+191
-191
lines changed

crates/ruff_formatter/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl std::fmt::Display for IndentStyle {
9292
}
9393
}
9494

95-
/// The visual width of a indentation.
95+
/// The visual width of an indentation.
9696
///
9797
/// Determines the visual width of a tab character (`\t`) and the number of
9898
/// spaces per indent when using [`IndentStyle::Space`].
@@ -207,7 +207,7 @@ pub trait FormatOptions {
207207
/// What's the max width of a line. Defaults to 80.
208208
fn line_width(&self) -> LineWidth;
209209

210-
/// Derives the print options from the these format options
210+
/// Derives the print options from these format options
211211
fn as_print_options(&self) -> PrinterOptions;
212212
}
213213

crates/ruff_linter/resources/test/fixtures/perflint/PERF401.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ def f():
144144

145145
def f():
146146
# make sure that `tmp` is not deleted
147-
tmp = 1; result = [] # commment should be protected
147+
tmp = 1; result = [] # comment should be protected
148148
for i in range(10):
149149
result.append(i + 1) # PERF401
150150

151151

152152
def f():
153153
# make sure that `tmp` is not deleted
154-
result = []; tmp = 1 # commment should be protected
154+
result = []; tmp = 1 # comment should be protected
155155
for i in range(10):
156156
result.append(i + 1) # PERF401
157157

crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF401_PERF401.py.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ PERF401.py:142:9: PERF401 Use a list comprehension to create a transformed list
9393

9494
PERF401.py:149:9: PERF401 Use a list comprehension to create a transformed list
9595
|
96-
147 | tmp = 1; result = [] # commment should be protected
96+
147 | tmp = 1; result = [] # comment should be protected
9797
148 | for i in range(10):
9898
149 | result.append(i + 1) # PERF401
9999
| ^^^^^^^^^^^^^^^^^^^^ PERF401
@@ -102,7 +102,7 @@ PERF401.py:149:9: PERF401 Use a list comprehension to create a transformed list
102102

103103
PERF401.py:156:9: PERF401 Use a list comprehension to create a transformed list
104104
|
105-
154 | result = []; tmp = 1 # commment should be protected
105+
154 | result = []; tmp = 1 # comment should be protected
106106
155 | for i in range(10):
107107
156 | result.append(i + 1) # PERF401
108108
| ^^^^^^^^^^^^^^^^^^^^ PERF401

crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__preview__PERF401_PERF401.py.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ PERF401.py:142:9: PERF401 [*] Use a list comprehension to create a transformed l
223223

224224
PERF401.py:149:9: PERF401 [*] Use a list comprehension to create a transformed list
225225
|
226-
147 | tmp = 1; result = [] # commment should be protected
226+
147 | tmp = 1; result = [] # comment should be protected
227227
148 | for i in range(10):
228228
149 | result.append(i + 1) # PERF401
229229
| ^^^^^^^^^^^^^^^^^^^^ PERF401
@@ -234,18 +234,18 @@ PERF401.py:149:9: PERF401 [*] Use a list comprehension to create a transformed l
234234
144 144 |
235235
145 145 | def f():
236236
146 146 | # make sure that `tmp` is not deleted
237-
147 |- tmp = 1; result = [] # commment should be protected
237+
147 |- tmp = 1; result = [] # comment should be protected
238238
148 |- for i in range(10):
239239
149 |- result.append(i + 1) # PERF401
240-
147 |+ tmp = 1 # commment should be protected
240+
147 |+ tmp = 1 # comment should be protected
241241
148 |+ result = [i + 1 for i in range(10)] # PERF401
242242
150 149 |
243243
151 150 |
244244
152 151 | def f():
245245

246246
PERF401.py:156:9: PERF401 [*] Use a list comprehension to create a transformed list
247247
|
248-
154 | result = []; tmp = 1 # commment should be protected
248+
154 | result = []; tmp = 1 # comment should be protected
249249
155 | for i in range(10):
250250
156 | result.append(i + 1) # PERF401
251251
| ^^^^^^^^^^^^^^^^^^^^ PERF401
@@ -256,10 +256,10 @@ PERF401.py:156:9: PERF401 [*] Use a list comprehension to create a transformed l
256256
151 151 |
257257
152 152 | def f():
258258
153 153 | # make sure that `tmp` is not deleted
259-
154 |- result = []; tmp = 1 # commment should be protected
259+
154 |- result = []; tmp = 1 # comment should be protected
260260
155 |- for i in range(10):
261261
156 |- result.append(i + 1) # PERF401
262-
154 |+ tmp = 1 # commment should be protected
262+
154 |+ tmp = 1 # comment should be protected
263263
155 |+ result = [i + 1 for i in range(10)] # PERF401
264264
157 156 |
265265
158 157 |

crates/ruff_python_ast/src/nodes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2844,7 +2844,7 @@ impl Arguments {
28442844
self.find_argument(name, position).map(ArgOrKeyword::value)
28452845
}
28462846

2847-
/// Return the the argument with the given name or at the given position, or `None` if no such
2847+
/// Return the argument with the given name or at the given position, or `None` if no such
28482848
/// argument exists. Used to retrieve arguments that can be provided _either_ as keyword or
28492849
/// positional arguments.
28502850
pub fn find_argument(&self, name: &str, position: usize) -> Option<ArgOrKeyword> {

crates/ruff_python_ast/src/visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ pub fn walk_except_handler<'a, V: Visitor<'a> + ?Sized>(
590590
}
591591

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

crates/ruff_python_ast/src/visitor/transformer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ pub fn walk_except_handler<V: Transformer + ?Sized>(
576576
}
577577

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

crates/ruff_python_parser/resources/invalid/expressions/parenthesized/tuple_starred_expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# For tuple expression, the minimum binding power of star expression is bitwise or.
2-
# Test the first and any other element as the there are two separate calls.
2+
# Test the first and any other element as there are two separate calls.
33

44
(*x in y, z, *x in y)
55
(*not x, z, *not x)

0 commit comments

Comments
 (0)