Skip to content

Commit

Permalink
Fix typos found by codespell (#14863)
Browse files Browse the repository at this point in the history
## Summary

Just fix typos.

## Test Plan

CI tests.

---------

Co-authored-by: Micha Reiser <[email protected]>
  • Loading branch information
DimitriPapadopoulos and MichaReiser authored Dec 9, 2024
1 parent 3d9ac53 commit 5914509
Show file tree
Hide file tree
Showing 34 changed files with 58 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ reveal_type(b) # revealed: tuple[int]
reveal_type(c) # revealed: tuple[str, int]
reveal_type(d) # revealed: tuple[tuple[str, str], tuple[int, int]]

# TODO: homogenous tuples, PEP-646 tuples
# TODO: homogeneous tuples, PEP-646 tuples
reveal_type(e) # revealed: @Todo(full tuple[...] support)
reveal_type(f) # revealed: @Todo(full tuple[...] support)
reveal_type(g) # revealed: @Todo(full tuple[...] support)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ reveal_type(sys.version_info[:2] == (3, 10)) # revealed: Literal[True]

### Grandchild

The same should work for arbitrarly nested sections:
The same should work for arbitrarily nested sections:

```py
reveal_type(sys.version_info[:2] == (3, 10)) # revealed: Literal[True]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Class defenitions in stubs
# Class definitions in stubs

## Cyclical class definition

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl SyncNotificationHandler for DidChangeTextDocumentHandler {
}
}

// TODO(dhruvmanila): Publish diagnostics if the client doesnt support pull diagnostics
// TODO(dhruvmanila): Publish diagnostics if the client doesn't support pull diagnostics

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion crates/red_knot_workspace/src/workspace/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ mod tests {
/// Folders that match the members pattern but don't have a pyproject.toml
/// aren't valid members and discovery fails. However, don't fail
/// if the folder name indicates that it is a hidden folder that might
/// have been crated by another tool
/// have been created by another tool
#[test]
fn member_pattern_matching_hidden_folder() -> anyhow::Result<()> {
let system = TestSystem::default();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,6 @@ def query54():
FROM {var}.table
"""

# to be handled seperately
# to be handled separately
# query58 = f"SELECT\
# * FROM {var}.table"
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def foo(x: int) -> int | None:
"""A very helpful docstring.
Args:
x (int): An interger.
x (int): An integer.
"""
if x < 0:
return None
Expand All @@ -191,7 +191,7 @@ def foo(x):
"""A very helpful docstring.
Args:
x (int): An interger.
x (int): An integer.
"""
if x < 0:
return None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def foo(x: int) -> int | None:
Parameters
----------
x : int
An interger.
An integer.
"""
if x < 0:
return None
Expand All @@ -169,7 +169,7 @@ def foo(x):
Parameters
----------
x : int
An interger.
An integer.
"""
if x < 0:
return None
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_linter/resources/test/fixtures/ruff/RUF041.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Literal[
1, # comment 1
Literal[ # another comment
1 # yet annother comment
1 # yet another comment
]
] # once

Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_linter/resources/test/fixtures/ruff/RUF041.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ t.Literal[1, t.Literal[2, t.Literal[1]]]
Literal[
1, # comment 1
Literal[ # another comment
1 # yet annother comment
1 # yet another comment
]
] # once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ fn generate_pep604_fix(
)
}

/// Generate a [`Fix`] for two or more type expresisons, e.g. `typing.Union[int, float, complex]`.
/// Generate a [`Fix`] for two or more type expressions, e.g. `typing.Union[int, float, complex]`.
fn generate_union_fix(
checker: &Checker,
nodes: Vec<&Expr>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ fn generate_pep604_fix(
)
}

/// Generate a [`Fix`] for two or more type expresisons, e.g. `typing.Union[int, float, complex]`.
/// Generate a [`Fix`] for two or more type expressions, e.g. `typing.Union[int, float, complex]`.
fn generate_union_fix(
checker: &Checker,
nodes: Vec<&Expr>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub(crate) fn unnecessary_type_union<'a>(checker: &mut Checker, union: &'a Expr)
}
}
UnionKind::TypingUnion => {
// When subscript is None, it uses the pervious match case.
// When subscript is None, it uses the previous match case.
let subscript = subscript.unwrap();
let types = &Expr::Subscript(ast::ExprSubscript {
value: Box::new(Expr::Name(ast::ExprName {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ DOC201_google.py:178:5: DOC201 `return` is not documented in docstring
| _____^
179 | |
180 | | Args:
181 | | x (int): An interger.
181 | | x (int): An integer.
182 | | """
| |_______^ DOC201
183 | if x < 0:
Expand All @@ -78,7 +78,7 @@ DOC201_google.py:191:5: DOC201 `return` is not documented in docstring
| _____^
192 | |
193 | | Args:
194 | | x (int): An interger.
194 | | x (int): An integer.
195 | | """
| |_______^ DOC201
196 | if x < 0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ DOC201_numpy.py:152:5: DOC201 `return` is not documented in docstring
154 | | Parameters
155 | | ----------
156 | | x : int
157 | | An interger.
157 | | An integer.
158 | | """
| |_______^ DOC201
159 | if x < 0:
Expand All @@ -76,7 +76,7 @@ DOC201_numpy.py:167:5: DOC201 `return` is not documented in docstring
169 | | Parameters
170 | | ----------
171 | | x : int
172 | | An interger.
172 | | An integer.
173 | | """
| |_______^ DOC201
174 | if x < 0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ RUF041.py:12:1: RUF041 [*] Unnecessary nested `Literal`
12 | / Literal[
13 | | 1, # comment 1
14 | | Literal[ # another comment
15 | | 1 # yet annother comment
15 | | 1 # yet another comment
16 | | ]
17 | | ] # once
| |_^ RUF041
Expand All @@ -148,7 +148,7 @@ RUF041.py:12:1: RUF041 [*] Unnecessary nested `Literal`
12 |-Literal[
13 |- 1, # comment 1
14 |- Literal[ # another comment
15 |- 1 # yet annother comment
15 |- 1 # yet another comment
16 |- ]
17 |-] # once
12 |+Literal[1, 1] # once
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ RUF041.pyi:12:1: RUF041 [*] Unnecessary nested `Literal`
12 | / Literal[
13 | | 1, # comment 1
14 | | Literal[ # another comment
15 | | 1 # yet annother comment
15 | | 1 # yet another comment
16 | | ]
17 | | ] # once
| |_^ RUF041
Expand All @@ -147,7 +147,7 @@ RUF041.pyi:12:1: RUF041 [*] Unnecessary nested `Literal`
12 |-Literal[
13 |- 1, # comment 1
14 |- Literal[ # another comment
15 |- 1 # yet annother comment
15 |- 1 # yet another comment
16 |- ]
17 |-] # once
12 |+Literal[1, 1] # once
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def foo2(parameter_1, parameter_2, parameter_3, parameter_4, parameter_5, parame
def foo3(parameter_1, parameter_2, parameter_3, parameter_4, parameter_5, parameter_6, parameter_7): pass
def foo4(parameter_1, parameter_2, parameter_3, parameter_4, parameter_5, parameter_6, parameter_7): pass

# Adding some unformated code covering a wide range of syntaxes.
# Adding some unformatted code covering a wide range of syntaxes.

if True:
# Incorrectly indented prefix comments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def foo3(

def foo4(parameter_1, parameter_2, parameter_3, parameter_4, parameter_5, parameter_6, parameter_7): pass

# Adding some unformated code covering a wide range of syntaxes.
# Adding some unformatted code covering a wide range of syntaxes.

if True:
# Incorrectly indented prefix comments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
z: (int) = 2.3
z: ((int)) = foo()

# In case I go for not enforcing parantheses, this might get improved at the same time
# In case I go for not enforcing parentheses, this might get improved at the same time
x = (
z
== 9999999999999999999999999999999999999999
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ z: Short | Short2 | Short3 | Short4 = 8
z: int = 2.3
z: int = foo()

# In case I go for not enforcing parantheses, this might get improved at the same time
# In case I go for not enforcing parentheses, this might get improved at the same time
x = (
z
== 9999999999999999999999999999999999999999
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Regresssion test for https://github.com/astral-sh/ruff/issues/11724
# Regression test for https://github.com/astral-sh/ruff/issues/11724

'''

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# F-strings
##############################################################################

# Escape `{` and `}` when marging an f-string with a string
# Escape `{` and `}` when merging an f-string with a string
"a {not_a_variable}" f"b {10}" "c"

# Join, and break expressions
Expand Down Expand Up @@ -96,7 +96,7 @@
f"{10 + len('bar')=}" f"{10 + len('bar')=}"
f"{10 + len('bar')=}" f'no debug{10}' f"{10 + len('bar')=}"

# We can't savely merge this pre Python 3.12 without altering the debug expression.
# We can't safely merge this pre Python 3.12 without altering the debug expression.
f"{10 + len('bar')=}" f'{10 + len("bar")=}'


Expand Down Expand Up @@ -259,7 +259,7 @@ def short_docstring():
"Implicit" "concatenated" "docstring"

def long_docstring():
"Loooooooooooooooooooooong" "doooooooooooooooooooocstriiiiiiiiiiiiiiiiiiiiiiiiiiiiiiing" "exceding the line width" "but it should be concatenated anyways because it is single line"
"Loooooooooooooooooooooong" "doooooooooooooooooooocstriiiiiiiiiiiiiiiiiiiiiiiiiiiiiiing" "exceeding the line width" "but it should be concatenated anyways because it is single line"

def docstring_with_leading_whitespace():
" This is a " "implicit" "concatenated" "docstring"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test3( a): <RANGE_START>print("body" )
# The if header and the print statement together are longer than 100 characters.
# The print statement should either be wrapped to fit at the end of the if statement, or be converted to a
# suite body
if aaaaaaaaaaaa + bbbbbbbbbbbbbb + cccccccccccccccccc + ddd: <RANGE_START>print("aaaa long body, should wrap or be intented" )<RANGE_END>
if aaaaaaaaaaaa + bbbbbbbbbbbbbb + cccccccccccccccccc + ddd: <RANGE_START>print("aaaa long body, should wrap or be indented" )<RANGE_END>

# This print statement is too-long even when intented. It should be wrapped
if aaaaaaaaaaaa + bbbbbbbbbbbbbb + cccccccccccccccccc + ddd: <RANGE_START>print("aaaa long body, should wrap or be intented", "more content to make it exceed the 88 chars limit")<RANGE_END>
# This print statement is too long even when indented. It should be wrapped
if aaaaaaaaaaaa + bbbbbbbbbbbbbb + cccccccccccccccccc + ddd: <RANGE_START>print("aaaa long body, should wrap or be indented", "more content to make it exceed the 88 chars limit")<RANGE_END>
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_return_union_with_elements_exceeding_length(


#########################################################################################
# Multiline stirngs (NeedsParentheses::Never)
# Multiline strings (NeedsParentheses::Never)
#########################################################################################


Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_python_formatter/src/preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub(crate) fn is_f_string_formatting_enabled(context: &PyFormatContext) -> bool
}

/// See [#13539](https://github.com/astral-sh/ruff/pull/13539)
/// Remove `Quoting` when stabalizing this preview style.
/// Remove `Quoting` when stabilizing this preview style.
pub(crate) fn is_f_string_implicit_concatenated_string_literal_quotes_enabled(
context: &PyFormatContext,
) -> bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ z: (Short
z: (int) = 2.3
z: ((int)) = foo()
# In case I go for not enforcing parantheses, this might get improved at the same time
# In case I go for not enforcing parentheses, this might get improved at the same time
x = (
z
== 9999999999999999999999999999999999999999
Expand Down Expand Up @@ -166,7 +166,7 @@ z: Short | Short2 | Short3 | Short4 = 8
z: int = 2.3
z: int = foo()
# In case I go for not enforcing parantheses, this might get improved at the same time
# In case I go for not enforcing parentheses, this might get improved at the same time
x = (
z
== 9999999999999999999999999999999999999999
Expand Down Expand Up @@ -270,7 +270,7 @@ z: Short | Short2 | Short3 | Short4 = 8
z: int = 2.3
z: int = foo()
# In case I go for not enforcing parantheses, this might get improved at the same time
# In case I go for not enforcing parentheses, this might get improved at the same time
x = (
z
== 9999999999999999999999999999999999999999
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ snapshot_kind: text
---
## Input
```python
# Regresssion test for https://github.com/astral-sh/ruff/issues/11724
# Regression test for https://github.com/astral-sh/ruff/issues/11724
'''

Expand All @@ -15,7 +15,7 @@ snapshot_kind: text

## Output
```python
# Regresssion test for https://github.com/astral-sh/ruff/issues/11724
# Regression test for https://github.com/astral-sh/ruff/issues/11724
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ b"aaaaaaaaa" b"bbbbbbbbbbbbbbbbbbbb" # Join
# F-strings
##############################################################################
# Escape `{` and `}` when marging an f-string with a string
# Escape `{` and `}` when merging an f-string with a string
"a {not_a_variable}" f"b {10}" "c"
# Join, and break expressions
Expand Down Expand Up @@ -102,7 +102,7 @@ f"{f'''test ' '''}" f'{f"""other " """}'
f"{10 + len('bar')=}" f"{10 + len('bar')=}"
f"{10 + len('bar')=}" f'no debug{10}' f"{10 + len('bar')=}"
# We can't savely merge this pre Python 3.12 without altering the debug expression.
# We can't safely merge this pre Python 3.12 without altering the debug expression.
f"{10 + len('bar')=}" f'{10 + len("bar")=}'
Expand Down Expand Up @@ -265,7 +265,7 @@ def short_docstring():
"Implicit" "concatenated" "docstring"
def long_docstring():
"Loooooooooooooooooooooong" "doooooooooooooooooooocstriiiiiiiiiiiiiiiiiiiiiiiiiiiiiiing" "exceding the line width" "but it should be concatenated anyways because it is single line"
"Loooooooooooooooooooooong" "doooooooooooooooooooocstriiiiiiiiiiiiiiiiiiiiiiiiiiiiiiing" "exceeding the line width" "but it should be concatenated anyways because it is single line"
def docstring_with_leading_whitespace():
" This is a " "implicit" "concatenated" "docstring"
Expand Down Expand Up @@ -427,7 +427,7 @@ b"aaaaaaaaabbbbbbbbbbbbbbbbbbbb" # Join
# F-strings
##############################################################################
# Escape `{` and `}` when marging an f-string with a string
# Escape `{` and `}` when merging an f-string with a string
f"a {{not_a_variable}}b {10}c"
# Join, and break expressions
Expand Down Expand Up @@ -463,7 +463,7 @@ f"{f'''test ' '''}" f'{f"""other " """}'
f"{10 + len('bar')=}{10 + len('bar')=}"
f"{10 + len('bar')=}no debug{10}{10 + len('bar')=}"
# We can't savely merge this pre Python 3.12 without altering the debug expression.
# We can't safely merge this pre Python 3.12 without altering the debug expression.
f"{10 + len('bar')=}" f'{10 + len("bar")=}'
Expand Down Expand Up @@ -690,7 +690,7 @@ def short_docstring():
def long_docstring():
"Loooooooooooooooooooooongdoooooooooooooooooooocstriiiiiiiiiiiiiiiiiiiiiiiiiiiiiiingexceding the line widthbut it should be concatenated anyways because it is single line"
"Loooooooooooooooooooooongdoooooooooooooooooooocstriiiiiiiiiiiiiiiiiiiiiiiiiiiiiiingexceeding the line widthbut it should be concatenated anyways because it is single line"
def docstring_with_leading_whitespace():
Expand Down
Loading

0 comments on commit 5914509

Please sign in to comment.