From 59145098d6bc541ce7b4428c3b5f2db59bcb7167 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:32:12 +0100 Subject: [PATCH] Fix typos found by codespell (#14863) ## Summary Just fix typos. ## Test Plan CI tests. --------- Co-authored-by: Micha Reiser --- .../resources/mdtest/assignment/annotations.md | 2 +- .../resources/mdtest/mdtest_config.md | 2 +- .../resources/mdtest/stubs/class.md | 2 +- .../src/server/api/notifications/did_change.rs | 2 +- crates/red_knot_workspace/src/workspace/metadata.rs | 2 +- .../resources/test/fixtures/flake8_bandit/S608.py | 2 +- .../test/fixtures/pydoclint/DOC201_google.py | 4 ++-- .../test/fixtures/pydoclint/DOC201_numpy.py | 4 ++-- .../resources/test/fixtures/ruff/RUF041.py | 2 +- .../resources/test/fixtures/ruff/RUF041.pyi | 2 +- .../rules/flake8_pyi/rules/duplicate_union_member.rs | 2 +- .../flake8_pyi/rules/redundant_numeric_union.rs | 2 +- .../rules/flake8_pyi/rules/unnecessary_type_union.rs | 2 +- ...__docstring-missing-returns_DOC201_google.py.snap | 4 ++-- ...s__docstring-missing-returns_DOC201_numpy.py.snap | 4 ++-- ...linter__rules__ruff__tests__RUF041_RUF041.py.snap | 4 ++-- ...inter__rules__ruff__tests__RUF041_RUF041.pyi.snap | 4 ++-- .../test/fixtures/black/cases/line_ranges_basic.py | 2 +- .../fixtures/black/cases/line_ranges_basic.py.expect | 2 +- .../black/cases/pep604_union_types_line_breaks.py | 2 +- .../cases/pep604_union_types_line_breaks.py.expect | 2 +- .../ruff/docstring_non_visible_characters.py | 2 +- .../expression/join_implicit_concatenated_string.py | 6 +++--- .../fixtures/ruff/range_formatting/same_line_body.py | 6 +++--- .../ruff/statement/return_type_parameters.py | 2 +- crates/ruff_python_formatter/src/preview.rs | 2 +- ...ity@cases__pep604_union_types_line_breaks.py.snap | 6 +++--- .../format@docstring_non_visible_characters.py.snap | 4 ++-- ...ession__join_implicit_concatenated_string.py.snap | 12 ++++++------ .../format@range_formatting__same_line_body.py.snap | 12 ++++++------ .../format@statement__return_type_parameters.py.snap | 4 ++-- crates/ruff_python_parser/src/parser/statement.rs | 2 +- .../src/server/api/notifications/did_change.rs | 2 +- .../src/server/api/notifications/did_open.rs | 2 +- 34 files changed, 58 insertions(+), 58 deletions(-) diff --git a/crates/red_knot_python_semantic/resources/mdtest/assignment/annotations.md b/crates/red_knot_python_semantic/resources/mdtest/assignment/annotations.md index ef401d4bf4..c83628b83e 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/assignment/annotations.md +++ b/crates/red_knot_python_semantic/resources/mdtest/assignment/annotations.md @@ -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) diff --git a/crates/red_knot_python_semantic/resources/mdtest/mdtest_config.md b/crates/red_knot_python_semantic/resources/mdtest/mdtest_config.md index d74e492d46..0f3b20868a 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/mdtest_config.md +++ b/crates/red_knot_python_semantic/resources/mdtest/mdtest_config.md @@ -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] diff --git a/crates/red_knot_python_semantic/resources/mdtest/stubs/class.md b/crates/red_knot_python_semantic/resources/mdtest/stubs/class.md index 63d60c4d5d..d2d209b3f4 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/stubs/class.md +++ b/crates/red_knot_python_semantic/resources/mdtest/stubs/class.md @@ -1,4 +1,4 @@ -# Class defenitions in stubs +# Class definitions in stubs ## Cyclical class definition diff --git a/crates/red_knot_server/src/server/api/notifications/did_change.rs b/crates/red_knot_server/src/server/api/notifications/did_change.rs index 79cd7b3092..b22989a6c8 100644 --- a/crates/red_knot_server/src/server/api/notifications/did_change.rs +++ b/crates/red_knot_server/src/server/api/notifications/did_change.rs @@ -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(()) } diff --git a/crates/red_knot_workspace/src/workspace/metadata.rs b/crates/red_knot_workspace/src/workspace/metadata.rs index a8ce01790a..fff479a336 100644 --- a/crates/red_knot_workspace/src/workspace/metadata.rs +++ b/crates/red_knot_workspace/src/workspace/metadata.rs @@ -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(); diff --git a/crates/ruff_linter/resources/test/fixtures/flake8_bandit/S608.py b/crates/ruff_linter/resources/test/fixtures/flake8_bandit/S608.py index 5377eb264c..500afdf02c 100644 --- a/crates/ruff_linter/resources/test/fixtures/flake8_bandit/S608.py +++ b/crates/ruff_linter/resources/test/fixtures/flake8_bandit/S608.py @@ -151,6 +151,6 @@ PRESELECT * FROM {var}.table """ -# to be handled seperately +# to be handled separately # query58 = f"SELECT\ # * FROM {var}.table" diff --git a/crates/ruff_linter/resources/test/fixtures/pydoclint/DOC201_google.py b/crates/ruff_linter/resources/test/fixtures/pydoclint/DOC201_google.py index a0b4f93871..1f5424e4bc 100644 --- a/crates/ruff_linter/resources/test/fixtures/pydoclint/DOC201_google.py +++ b/crates/ruff_linter/resources/test/fixtures/pydoclint/DOC201_google.py @@ -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 @@ -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 diff --git a/crates/ruff_linter/resources/test/fixtures/pydoclint/DOC201_numpy.py b/crates/ruff_linter/resources/test/fixtures/pydoclint/DOC201_numpy.py index 396fc45713..2614a17eeb 100644 --- a/crates/ruff_linter/resources/test/fixtures/pydoclint/DOC201_numpy.py +++ b/crates/ruff_linter/resources/test/fixtures/pydoclint/DOC201_numpy.py @@ -154,7 +154,7 @@ def foo(x: int) -> int | None: Parameters ---------- x : int - An interger. + An integer. """ if x < 0: return None @@ -169,7 +169,7 @@ def foo(x): Parameters ---------- x : int - An interger. + An integer. """ if x < 0: return None diff --git a/crates/ruff_linter/resources/test/fixtures/ruff/RUF041.py b/crates/ruff_linter/resources/test/fixtures/ruff/RUF041.py index 44adc4e364..f783e566e1 100644 --- a/crates/ruff_linter/resources/test/fixtures/ruff/RUF041.py +++ b/crates/ruff_linter/resources/test/fixtures/ruff/RUF041.py @@ -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 diff --git a/crates/ruff_linter/resources/test/fixtures/ruff/RUF041.pyi b/crates/ruff_linter/resources/test/fixtures/ruff/RUF041.pyi index 44adc4e364..f783e566e1 100644 --- a/crates/ruff_linter/resources/test/fixtures/ruff/RUF041.pyi +++ b/crates/ruff_linter/resources/test/fixtures/ruff/RUF041.pyi @@ -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 diff --git a/crates/ruff_linter/src/rules/flake8_pyi/rules/duplicate_union_member.rs b/crates/ruff_linter/src/rules/flake8_pyi/rules/duplicate_union_member.rs index e98064e965..a41f839537 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/rules/duplicate_union_member.rs +++ b/crates/ruff_linter/src/rules/flake8_pyi/rules/duplicate_union_member.rs @@ -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>, diff --git a/crates/ruff_linter/src/rules/flake8_pyi/rules/redundant_numeric_union.rs b/crates/ruff_linter/src/rules/flake8_pyi/rules/redundant_numeric_union.rs index 85d75ff23c..418b0e862d 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/rules/redundant_numeric_union.rs +++ b/crates/ruff_linter/src/rules/flake8_pyi/rules/redundant_numeric_union.rs @@ -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>, diff --git a/crates/ruff_linter/src/rules/flake8_pyi/rules/unnecessary_type_union.rs b/crates/ruff_linter/src/rules/flake8_pyi/rules/unnecessary_type_union.rs index c069e4d4f9..c4abd33083 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/rules/unnecessary_type_union.rs +++ b/crates/ruff_linter/src/rules/flake8_pyi/rules/unnecessary_type_union.rs @@ -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 { diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_google.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_google.py.snap index 8bd4cca108..ec835deb8b 100644 --- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_google.py.snap +++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_google.py.snap @@ -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: @@ -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: diff --git a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_numpy.py.snap b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_numpy.py.snap index 98f685958b..7e4fab9e97 100644 --- a/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_numpy.py.snap +++ b/crates/ruff_linter/src/rules/pydoclint/snapshots/ruff_linter__rules__pydoclint__tests__docstring-missing-returns_DOC201_numpy.py.snap @@ -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: @@ -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: diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF041_RUF041.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF041_RUF041.py.snap index 922ac7747d..83e59df5ea 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF041_RUF041.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF041_RUF041.py.snap @@ -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 @@ -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 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF041_RUF041.pyi.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF041_RUF041.pyi.snap index 14c703e888..faf9638519 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF041_RUF041.pyi.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF041_RUF041.pyi.snap @@ -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 @@ -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 diff --git a/crates/ruff_python_formatter/resources/test/fixtures/black/cases/line_ranges_basic.py b/crates/ruff_python_formatter/resources/test/fixtures/black/cases/line_ranges_basic.py index c39bb99bcf..3dc4e3af71 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/black/cases/line_ranges_basic.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/black/cases/line_ranges_basic.py @@ -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. diff --git a/crates/ruff_python_formatter/resources/test/fixtures/black/cases/line_ranges_basic.py.expect b/crates/ruff_python_formatter/resources/test/fixtures/black/cases/line_ranges_basic.py.expect index 7fdfdfd0db..01c9c002e3 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/black/cases/line_ranges_basic.py.expect +++ b/crates/ruff_python_formatter/resources/test/fixtures/black/cases/line_ranges_basic.py.expect @@ -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. diff --git a/crates/ruff_python_formatter/resources/test/fixtures/black/cases/pep604_union_types_line_breaks.py b/crates/ruff_python_formatter/resources/test/fixtures/black/cases/pep604_union_types_line_breaks.py index bd3e48417b..930759735b 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/black/cases/pep604_union_types_line_breaks.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/black/cases/pep604_union_types_line_breaks.py @@ -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 diff --git a/crates/ruff_python_formatter/resources/test/fixtures/black/cases/pep604_union_types_line_breaks.py.expect b/crates/ruff_python_formatter/resources/test/fixtures/black/cases/pep604_union_types_line_breaks.py.expect index ab0a4d9677..e9c2f75f7e 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/black/cases/pep604_union_types_line_breaks.py.expect +++ b/crates/ruff_python_formatter/resources/test/fixtures/black/cases/pep604_union_types_line_breaks.py.expect @@ -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 diff --git a/crates/ruff_python_formatter/resources/test/fixtures/ruff/docstring_non_visible_characters.py b/crates/ruff_python_formatter/resources/test/fixtures/ruff/docstring_non_visible_characters.py index 0b816c10a4..f35943561b 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/ruff/docstring_non_visible_characters.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/ruff/docstring_non_visible_characters.py @@ -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 '''  diff --git a/crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/join_implicit_concatenated_string.py b/crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/join_implicit_concatenated_string.py index 184e727a26..ede789e997 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/join_implicit_concatenated_string.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/join_implicit_concatenated_string.py @@ -55,7 +55,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 @@ -96,7 +96,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")=}' @@ -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" diff --git a/crates/ruff_python_formatter/resources/test/fixtures/ruff/range_formatting/same_line_body.py b/crates/ruff_python_formatter/resources/test/fixtures/ruff/range_formatting/same_line_body.py index 6e0adcd6a2..d9ad82648e 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/ruff/range_formatting/same_line_body.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/ruff/range_formatting/same_line_body.py @@ -13,7 +13,7 @@ print("after" ) # 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: print("aaaa long body, should wrap or be intented" ) +if aaaaaaaaaaaa + bbbbbbbbbbbbbb + cccccccccccccccccc + ddd: print("aaaa long body, should wrap or be indented" ) -# This print statement is too-long even when intented. It should be wrapped -if aaaaaaaaaaaa + bbbbbbbbbbbbbb + cccccccccccccccccc + ddd: print("aaaa long body, should wrap or be intented", "more content to make it exceed the 88 chars limit") +# This print statement is too long even when indented. It should be wrapped +if aaaaaaaaaaaa + bbbbbbbbbbbbbb + cccccccccccccccccc + ddd: print("aaaa long body, should wrap or be indented", "more content to make it exceed the 88 chars limit") diff --git a/crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/return_type_parameters.py b/crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/return_type_parameters.py index c97a7e7174..b866a86b5c 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/return_type_parameters.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/return_type_parameters.py @@ -54,7 +54,7 @@ def test_return_union_with_elements_exceeding_length( ######################################################################################### -# Multiline stirngs (NeedsParentheses::Never) +# Multiline strings (NeedsParentheses::Never) ######################################################################################### diff --git a/crates/ruff_python_formatter/src/preview.rs b/crates/ruff_python_formatter/src/preview.rs index 3509448dc7..c9b0c0968e 100644 --- a/crates/ruff_python_formatter/src/preview.rs +++ b/crates/ruff_python_formatter/src/preview.rs @@ -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 { diff --git a/crates/ruff_python_formatter/tests/snapshots/black_compatibility@cases__pep604_union_types_line_breaks.py.snap b/crates/ruff_python_formatter/tests/snapshots/black_compatibility@cases__pep604_union_types_line_breaks.py.snap index d022f12050..dc61db96dc 100644 --- a/crates/ruff_python_formatter/tests/snapshots/black_compatibility@cases__pep604_union_types_line_breaks.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/black_compatibility@cases__pep604_union_types_line_breaks.py.snap @@ -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 @@ -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 @@ -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 diff --git a/crates/ruff_python_formatter/tests/snapshots/format@docstring_non_visible_characters.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@docstring_non_visible_characters.py.snap index 502ba11a38..ae7ba4d031 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@docstring_non_visible_characters.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@docstring_non_visible_characters.py.snap @@ -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 '''  @@ -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 """  diff --git a/crates/ruff_python_formatter/tests/snapshots/format@expression__join_implicit_concatenated_string.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@expression__join_implicit_concatenated_string.py.snap index ff4ba5eb5e..46cfbbd167 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@expression__join_implicit_concatenated_string.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@expression__join_implicit_concatenated_string.py.snap @@ -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 @@ -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")=}' @@ -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" @@ -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 @@ -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")=}' @@ -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(): diff --git a/crates/ruff_python_formatter/tests/snapshots/format@range_formatting__same_line_body.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@range_formatting__same_line_body.py.snap index 38483c141b..1f29bc3488 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@range_formatting__same_line_body.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@range_formatting__same_line_body.py.snap @@ -20,10 +20,10 @@ print("after" ) # 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: print("aaaa long body, should wrap or be intented" ) +if aaaaaaaaaaaa + bbbbbbbbbbbbbb + cccccccccccccccccc + ddd: print("aaaa long body, should wrap or be indented" ) -# This print statement is too-long even when intented. It should be wrapped -if aaaaaaaaaaaa + bbbbbbbbbbbbbb + cccccccccccccccccc + ddd: print("aaaa long body, should wrap or be intented", "more content to make it exceed the 88 chars limit") +# This print statement is too long even when indented. It should be wrapped +if aaaaaaaaaaaa + bbbbbbbbbbbbbb + cccccccccccccccccc + ddd: print("aaaa long body, should wrap or be indented", "more content to make it exceed the 88 chars limit") ``` ## Output @@ -48,12 +48,12 @@ print("after" ) # 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: - print("aaaa long body, should wrap or be intented") + print("aaaa long body, should wrap or be indented") -# This print statement is too-long even when intented. It should be wrapped +# This print statement is too long even when indented. It should be wrapped if aaaaaaaaaaaa + bbbbbbbbbbbbbb + cccccccccccccccccc + ddd: print( - "aaaa long body, should wrap or be intented", + "aaaa long body, should wrap or be indented", "more content to make it exceed the 88 chars limit", ) ``` diff --git a/crates/ruff_python_formatter/tests/snapshots/format@statement__return_type_parameters.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@statement__return_type_parameters.py.snap index 4e0a850bba..1fc45eaee6 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@statement__return_type_parameters.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@statement__return_type_parameters.py.snap @@ -61,7 +61,7 @@ def test_return_union_with_elements_exceeding_length( ######################################################################################### -# Multiline stirngs (NeedsParentheses::Never) +# Multiline strings (NeedsParentheses::Never) ######################################################################################### @@ -260,7 +260,7 @@ def test_return_union_with_elements_exceeding_length( ######################################################################################### -# Multiline stirngs (NeedsParentheses::Never) +# Multiline strings (NeedsParentheses::Never) ######################################################################################### diff --git a/crates/ruff_python_parser/src/parser/statement.rs b/crates/ruff_python_parser/src/parser/statement.rs index e10487e18c..3b7c37636c 100644 --- a/crates/ruff_python_parser/src/parser/statement.rs +++ b/crates/ruff_python_parser/src/parser/statement.rs @@ -2140,7 +2140,7 @@ impl<'src> Parser<'src> { /// it's used in the context of a subscript expression or as a list expression: /// /// ```python - /// # Subcript expression; `match` is an identifier + /// # Subscript expression; `match` is an identifier /// match[x] /// /// # List expression; `match` is a keyword diff --git a/crates/ruff_server/src/server/api/notifications/did_change.rs b/crates/ruff_server/src/server/api/notifications/did_change.rs index 27ee65a3a1..6dd8253f94 100644 --- a/crates/ruff_server/src/server/api/notifications/did_change.rs +++ b/crates/ruff_server/src/server/api/notifications/did_change.rs @@ -33,7 +33,7 @@ impl super::SyncNotificationHandler for DidChange { .update_text_document(&key, content_changes, new_version) .with_failure_code(ErrorCode::InternalError)?; - // Publish diagnostics if the client doesnt support pull diagnostics + // Publish diagnostics if the client doesn't support pull diagnostics if !session.resolved_client_capabilities().pull_diagnostics { let snapshot = session.take_snapshot(key.into_url()).unwrap(); publish_diagnostics_for_document(&snapshot, ¬ifier)?; diff --git a/crates/ruff_server/src/server/api/notifications/did_open.rs b/crates/ruff_server/src/server/api/notifications/did_open.rs index 848269aa6b..5e3e08ec98 100644 --- a/crates/ruff_server/src/server/api/notifications/did_open.rs +++ b/crates/ruff_server/src/server/api/notifications/did_open.rs @@ -32,7 +32,7 @@ impl super::SyncNotificationHandler for DidOpen { session.open_text_document(uri.clone(), document); - // Publish diagnostics if the client doesnt support pull diagnostics + // Publish diagnostics if the client doesn't support pull diagnostics if !session.resolved_client_capabilities().pull_diagnostics { let snapshot = session .take_snapshot(uri.clone())