Skip to content

Commit

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

Fix typos found by
[codespell](https://github.com/codespell-project/codespell).

## Test Plan

CI tests.
  • Loading branch information
DimitriPapadopoulos authored Jan 2, 2024
1 parent cd0493d commit d04d49c
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def method1(self) -> T:
async with trio.move_on_at(1):
pass

# Do not supress combination, if a context manager is already combined with another.
# Do not suppress combination, if a context manager is already combined with another.
async with asyncio.timeout(1), A():
async with B():
pass
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Foo:
TCLS = typing.TypeVar["TCLS"]
y: typing.TypeAlias = list[TCLS]

# UP040 wont add generics in fix
# UP040 won't add generics in fix
T = typing.TypeVar(*args)
x: typing.TypeAlias = list[T]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ SIM117.py:126:1: SIM117 [*] Use a single `with` statement with multiple contexts

SIM117.py:163:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements
|
162 | # Do not supress combination, if a context manager is already combined with another.
162 | # Do not suppress combination, if a context manager is already combined with another.
163 | / async with asyncio.timeout(1), A():
164 | | async with B():
| |___________________^ SIM117
Expand All @@ -333,7 +333,7 @@ SIM117.py:163:1: SIM117 [*] Use a single `with` statement with multiple contexts
Unsafe fix
160 160 | pass
161 161 |
162 162 | # Do not supress combination, if a context manager is already combined with another.
162 162 | # Do not suppress combination, if a context manager is already combined with another.
163 |-async with asyncio.timeout(1), A():
164 |- async with B():
165 |- pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ UP040.py:40:5: UP040 [*] Type alias `y` uses `TypeAlias` annotation instead of t
40 | y: typing.TypeAlias = list[TCLS]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP040
41 |
42 | # UP040 wont add generics in fix
42 | # UP040 won't add generics in fix
|
= help: Use the `type` keyword
Expand All @@ -206,12 +206,12 @@ UP040.py:40:5: UP040 [*] Type alias `y` uses `TypeAlias` annotation instead of t
40 |- y: typing.TypeAlias = list[TCLS]
40 |+ type y[TCLS] = list[TCLS]
41 41 |
42 42 | # UP040 wont add generics in fix
42 42 | # UP040 won't add generics in fix
43 43 | T = typing.TypeVar(*args)
UP040.py:44:1: UP040 [*] Type alias `x` uses `TypeAlias` annotation instead of the `type` keyword
|
42 | # UP040 wont add generics in fix
42 | # UP040 won't add generics in fix
43 | T = typing.TypeVar(*args)
44 | x: typing.TypeAlias = list[T]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP040
Expand All @@ -222,7 +222,7 @@ UP040.py:44:1: UP040 [*] Type alias `x` uses `TypeAlias` annotation instead of t
ℹ Unsafe fix
41 41 |
42 42 | # UP040 wont add generics in fix
42 42 | # UP040 won't add generics in fix
43 43 | T = typing.TypeVar(*args)
44 |-x: typing.TypeAlias = list[T]
44 |+type x = list[T]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,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
Expand Up @@ -32,7 +32,7 @@ def import_fixture(fixture: Path, fixture_set: str):
input.append(line)

if not expected:
# If there's no output marker, tread the whole file as already pre-formatted
# If there's no output marker, treat the whole file as already pre-formatted
expected = input

options = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def doctest_varying_start_column():
# actually extend past the configured line limit.
#
# It's not quite clear whether this is desirable or not. We could in
# theory compute the intendation length of a code snippet and then
# theory compute the indentation length of a code snippet and then
# adjust the line-width setting on a recursive call to the formatter.
# But there are assuredly pathological cases to consider. Another path
# would be to expose another formatter option for controlling the
Expand All @@ -244,7 +244,7 @@ def doctest_long_lines():
But this one is long enough to get wrapped.
>>> foo, bar, quux = this_is_a_long_line(lion, giraffe, hippo, zeba, lemur, penguin, monkey, spider, bear, leopard)
'''
# This demostrates a normal line that will get wrapped but won't
# This demonstrates a normal line that will get wrapped but won't
# get wrapped in the docstring above because of how the line-width
# setting gets reset at the first column in each code snippet.
foo, bar, quux = this_is_a_long_line(lion, giraffe, hippo, zeba, lemur, penguin, monkey)
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_python_formatter/src/expression/binary_like.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ impl<'a> FlatBinaryExpressionSlice<'a> {
/// The formatting is recursive (with a depth of `O(operators)` where `operators` are operators with different precedences).
///
/// Comments before or after the first operand must be formatted by the caller because they shouldn't be part of the group
/// wrapping the whole binary chain. This is to avoid that `b * c` expands in the following example because of its trailing comemnt:
/// wrapping the whole binary chain. This is to avoid that `b * c` expands in the following example because of its trailing comment:
///
/// ```python
///
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_python_formatter/src/string/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ impl UnicodeEscape {
}
}
} else {
// Unterminated escape sequence, dont' normalise it.
// Unterminated escape sequence, don't normalise it.
return None;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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 Expand Up @@ -89,7 +89,7 @@ async def test_async_unformatted( ): # Trailing comment with extra leading
+ 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 Expand Up @@ -207,7 +207,7 @@ def foo4(
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 Expand Up @@ -279,7 +279,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 @@ -26,7 +26,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 @@ -165,7 +165,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 @@ -269,7 +269,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
Loading

0 comments on commit d04d49c

Please sign in to comment.