mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
Spellcheck & grammar (#10375)
## Summary I used `codespell` and `gramma` to identify mispellings and grammar errors throughout the codebase and fixed them. I tried not to make any controversial changes, but feel free to revert as you see fit.
This commit is contained in:
parent
c56fb6e15a
commit
3ed707f245
67 changed files with 135 additions and 170 deletions
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -19,7 +19,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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -148,7 +148,7 @@ class TabbedIndent:
|
|||
"""check for correct tabbed formatting
|
||||
^^^^^^^^^^
|
||||
Normal indented line
|
||||
- autor
|
||||
- author
|
||||
"""
|
||||
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ f"aaaaaa {[
|
|||
yyyyyyyyyyyy
|
||||
]} ccccccc"
|
||||
|
||||
# Remove the parenthese because they aren't required
|
||||
# Remove the parentheses because they aren't required
|
||||
xxxxxxxxxxxxxxx = (
|
||||
f"aaaaaaaaaaaaaaaa bbbbbbbbbbbbbbb {
|
||||
xxxxxxxxxxx # comment 14
|
||||
|
@ -214,7 +214,7 @@ f"{ # comment 15
|
|||
# removed once we have a strict parser.
|
||||
x = f"aaaaaaaaa { x ! r }"
|
||||
|
||||
# Even in the case of debug expresions, we only need to preserve the whitespace within
|
||||
# Even in the case of debug expressions, we only need to preserve the whitespace within
|
||||
# the expression part of the replacement field.
|
||||
x = f"aaaaaaaaa { x = ! r }"
|
||||
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
# the target version is 3.12 or later. A user can have 3.12 syntax even if the target
|
||||
# version isn't set.
|
||||
|
||||
# Quotes re-use
|
||||
# Quotes reuse
|
||||
f"{'a'}"
|
||||
|
|
|
@ -5,5 +5,5 @@ def test():
|
|||
if unformatted + a:
|
||||
pass
|
||||
|
||||
# Get's formatted again
|
||||
# Gets formatted again
|
||||
a + b
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Get's formatted
|
||||
# Gets formatted
|
||||
a + b
|
||||
|
||||
# fmt: off
|
||||
a + [1, 2, 3, 4, 5 ]
|
||||
# fmt: on
|
||||
|
||||
# Get's formatted again
|
||||
# Gets formatted again
|
||||
a + b
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# Get's formatted
|
||||
# Gets formatted
|
||||
a + b
|
||||
|
||||
# yapf: disable
|
||||
a + [1, 2, 3, 4, 5 ]
|
||||
# yapf: enable
|
||||
|
||||
# Get's formatted again
|
||||
# Gets formatted again
|
||||
a + b
|
||||
|
||||
|
||||
|
@ -13,5 +13,5 @@ a + b
|
|||
a + [1, 2, 3, 4, 5 ]
|
||||
# fmt: on
|
||||
|
||||
# Get's formatted again
|
||||
# Gets formatted again
|
||||
a + b
|
||||
|
|
|
@ -12,7 +12,7 @@ class <RANGE_START> Test(OtherClass<RANGE_END>)\
|
|||
def __init__( self):
|
||||
print("hello")
|
||||
|
||||
print( "dont' format this")
|
||||
print( "don't format this")
|
||||
|
||||
|
||||
def test2(<RANGE_START>a, b, c: str, d):<RANGE_END>
|
||||
|
|
|
@ -195,7 +195,7 @@ a[aaaaaaa, b] = (
|
|||
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc # comment
|
||||
)
|
||||
|
||||
# Format both as flat, but don't loos the comment.
|
||||
# Format both as flat, but don't lose the comment.
|
||||
a[aaaaaaa, b] = bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb # comment
|
||||
|
||||
#######################################################
|
||||
|
|
|
@ -66,20 +66,20 @@ raise ( # another comment
|
|||
raise (
|
||||
) # what now
|
||||
|
||||
raise ( # sould I stay here
|
||||
raise ( # should I stay here
|
||||
# just a comment here
|
||||
) # trailing comment
|
||||
|
||||
raise hello( # sould I stay here
|
||||
raise hello( # should I stay here
|
||||
# just a comment here
|
||||
) # trailing comment
|
||||
|
||||
raise ( # sould I stay here
|
||||
raise ( # should I stay here
|
||||
test,
|
||||
# just a comment here
|
||||
) # trailing comment
|
||||
|
||||
raise hello( # sould I stay here
|
||||
raise hello( # should I stay here
|
||||
# just a comment here
|
||||
"hey"
|
||||
) # trailing comment
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue