mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-02 04:48:06 +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
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -341,5 +341,3 @@ def f(
|
|||
another_option: bool = False,
|
||||
): ...
|
||||
```
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ class TabbedIndent:
|
|||
"""check for correct tabbed formatting
|
||||
^^^^^^^^^^
|
||||
Normal indented line
|
||||
- autor
|
||||
- author
|
||||
"""
|
||||
|
||||
|
||||
|
|
@ -330,7 +330,7 @@ class TabbedIndent:
|
|||
"""check for correct tabbed formatting
|
||||
^^^^^^^^^^
|
||||
Normal indented line
|
||||
- autor
|
||||
- author
|
||||
"""
|
||||
|
||||
|
||||
|
|
@ -506,7 +506,7 @@ class TabbedIndent:
|
|||
"""check for correct tabbed formatting
|
||||
^^^^^^^^^^
|
||||
Normal indented line
|
||||
- autor
|
||||
- author
|
||||
"""
|
||||
|
||||
|
||||
|
|
@ -682,7 +682,7 @@ class TabbedIndent:
|
|||
"""check for correct tabbed formatting
|
||||
^^^^^^^^^^
|
||||
Normal indented line
|
||||
- autor
|
||||
- author
|
||||
"""
|
||||
|
||||
|
||||
|
|
@ -858,7 +858,7 @@ class TabbedIndent:
|
|||
"""check for correct tabbed formatting
|
||||
^^^^^^^^^^
|
||||
Normal indented line
|
||||
- autor
|
||||
- author
|
||||
"""
|
||||
|
||||
|
||||
|
|
@ -1034,7 +1034,7 @@ class TabbedIndent:
|
|||
"""check for correct tabbed formatting
|
||||
^^^^^^^^^^
|
||||
Normal indented line
|
||||
- autor
|
||||
- author
|
||||
"""
|
||||
|
||||
|
||||
|
|
@ -1042,6 +1042,3 @@ def single_quoted():
|
|||
"content\ "
|
||||
return
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -195,7 +195,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
|
||||
|
|
@ -220,7 +220,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 }"
|
||||
|
||||
|
|
@ -510,7 +510,7 @@ f"aaaaaa {
|
|||
]
|
||||
} ccccccc"
|
||||
|
||||
# Remove the parenthese because they aren't required
|
||||
# Remove the parentheses because they aren't required
|
||||
xxxxxxxxxxxxxxx = f"aaaaaaaaaaaaaaaa bbbbbbbbbbbbbbb {
|
||||
xxxxxxxxxxx # comment 14
|
||||
+ yyyyyyyyyy
|
||||
|
|
@ -533,7 +533,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}"
|
||||
|
||||
|
|
@ -804,7 +804,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
|
||||
+ yyyyyyyyyy
|
||||
|
|
@ -827,7 +827,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 }"
|
||||
|
||||
|
|
@ -1086,7 +1086,7 @@ hello {
|
|||
+ ]
|
||||
+} ccccccc"
|
||||
|
||||
# Remove the parenthese because they aren't required
|
||||
# Remove the parentheses because they aren't required
|
||||
xxxxxxxxxxxxxxx = f"aaaaaaaaaaaaaaaa bbbbbbbbbbbbbbb {
|
||||
- xxxxxxxxxxx # comment 14
|
||||
- + yyyyyyyyyy
|
||||
|
|
@ -1113,7 +1113,7 @@ hello {
|
|||
-x = f"aaaaaaaaa { x ! r }"
|
||||
+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 }"
|
||||
+x = f"aaaaaaaaa { x = !r}"
|
||||
|
|
@ -1202,6 +1202,3 @@ hello {
|
|||
+ } --------
|
||||
"""
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/expression
|
|||
# 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'}"
|
||||
```
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ source_type = Python
|
|||
# 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'}"
|
||||
```
|
||||
|
||||
|
|
@ -45,10 +45,7 @@ f"{'a'}"
|
|||
@@ -3,4 +3,4 @@
|
||||
# version isn't set.
|
||||
|
||||
# Quotes re-use
|
||||
# Quotes reuse
|
||||
-f"{'a'}"
|
||||
+f"{"a"}"
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ def test():
|
|||
if unformatted + a:
|
||||
pass
|
||||
|
||||
# Get's formatted again
|
||||
# Gets formatted again
|
||||
a + b
|
||||
```
|
||||
|
||||
|
|
@ -25,9 +25,6 @@ def test():
|
|||
pass
|
||||
|
||||
|
||||
# Get's formatted again
|
||||
# Gets formatted again
|
||||
a + b
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,29 +4,26 @@ input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_on_off
|
|||
---
|
||||
## Input
|
||||
```python
|
||||
# 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
|
||||
```
|
||||
|
||||
## Output
|
||||
```python
|
||||
# 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
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@ input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_on_off
|
|||
---
|
||||
## Input
|
||||
```python
|
||||
# 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
|
||||
|
||||
|
||||
|
|
@ -19,20 +19,20 @@ a + b
|
|||
a + [1, 2, 3, 4, 5 ]
|
||||
# fmt: on
|
||||
|
||||
# Get's formatted again
|
||||
# Gets formatted again
|
||||
a + b
|
||||
```
|
||||
|
||||
## Output
|
||||
```python
|
||||
# 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
|
||||
|
||||
|
||||
|
|
@ -40,9 +40,6 @@ a + b
|
|||
a + [1, 2, 3, 4, 5 ]
|
||||
# fmt: on
|
||||
|
||||
# Get's formatted again
|
||||
# Gets formatted again
|
||||
a + b
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,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>
|
||||
|
|
@ -65,7 +65,7 @@ class Test(OtherClass): # comment
|
|||
def __init__( self):
|
||||
print("hello")
|
||||
|
||||
print( "dont' format this")
|
||||
print( "don't format this")
|
||||
|
||||
|
||||
def test2(a, b, c: str, d):
|
||||
|
|
@ -96,6 +96,3 @@ if a + b: # trailing clause header comment
|
|||
if b + c: # trailing clause header comment
|
||||
print("Not formatted" )
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -201,7 +201,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
|
||||
|
||||
#######################################################
|
||||
|
|
@ -455,7 +455,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
|
||||
|
||||
#######################################################
|
||||
|
|
@ -488,6 +488,3 @@ type A[
|
|||
VeryLongTypeNameThatShouldBreakFirstToTheRightBeforeSplitngtinthatExceedsTheWidth
|
||||
] = str
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -72,20 +72,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
|
||||
|
|
@ -195,24 +195,21 @@ 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