From 3899f7156fef568bc3bdaafd0c42e45afd191bf6 Mon Sep 17 00:00:00 2001 From: John Stilley <1831479+john-science@users.noreply.github.com> Date: Sun, 23 Mar 2025 10:55:14 -0700 Subject: [PATCH] Fixing more spelling errors (#16926) ## Summary Here I fix the last English spelling errors I could find in the repo. Again, I am trying not to touch variable/function names, or anything that might be misspelled in the API. The goal is to make this PR safe and easy to merge. ## Test Plan I have run all the unit tests. Though, again, all of the changes I make here are to docs and docstrings. I make no code changes, which I believe should greatly mitigate the testing concerns. --- .../red_knot_python_semantic/resources/mdtest/attributes.md | 6 +++--- .../resources/mdtest/import/star.md | 2 +- .../resources/mdtest/scopes/eager.md | 2 +- .../resources/mdtest/stubs/class.md | 2 +- .../vendor/typeshed/stdlib/email/message.pyi | 2 +- crates/ruff_benchmark/resources/large/dataset.py | 2 +- crates/ruff_formatter/src/printer/mod.rs | 2 +- crates/ruff_linter/src/rules/pyflakes/mod.rs | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/red_knot_python_semantic/resources/mdtest/attributes.md b/crates/red_knot_python_semantic/resources/mdtest/attributes.md index ead2d8192d..9e0e0684d8 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/attributes.md +++ b/crates/red_knot_python_semantic/resources/mdtest/attributes.md @@ -697,10 +697,10 @@ class Base: self.defined_in_init: str | None = "value in base" class Intermediate(Base): - # Re-declaring base class attributes with the *same *type is fine: + # Redeclaring base class attributes with the *same *type is fine: base_class_attribute_1: str | None = None - # Re-declaring them with a *narrower type* is unsound, because modifications + # Redeclaring them with a *narrower type* is unsound, because modifications # through a `Base` reference could violate that constraint. # # Mypy does not report an error here, but pyright does: "… overrides symbol @@ -712,7 +712,7 @@ class Intermediate(Base): # TODO: This should be an error base_class_attribute_2: str - # Re-declaring attributes with a *wider type* directly violates LSP. + # Redeclaring attributes with a *wider type* directly violates LSP. # # In this case, both mypy and pyright report an error. # diff --git a/crates/red_knot_python_semantic/resources/mdtest/import/star.md b/crates/red_knot_python_semantic/resources/mdtest/import/star.md index cb13ef8416..250480e082 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/import/star.md +++ b/crates/red_knot_python_semantic/resources/mdtest/import/star.md @@ -222,7 +222,7 @@ reveal_type(X) # revealed: Unknown ### Only explicit re-exports are considered re-exported from `.pyi` files For `.pyi` files, we should consider all imports private to the stub unless they are included in -`__all__` or use the explict `from foo import X as X` syntax. +`__all__` or use the explicit `from foo import X as X` syntax. `a.pyi`: diff --git a/crates/red_knot_python_semantic/resources/mdtest/scopes/eager.md b/crates/red_knot_python_semantic/resources/mdtest/scopes/eager.md index 3e772d98ef..37120f3faa 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/scopes/eager.md +++ b/crates/red_knot_python_semantic/resources/mdtest/scopes/eager.md @@ -1,7 +1,7 @@ # Eager scopes Some scopes are executed eagerly: references to variables defined in enclosing scopes are resolved -_immediately_. This is in constrast to (for instance) function scopes, where those references are +_immediately_. This is in contrast to (for instance) function scopes, where those references are resolved when the function is called. ## Function definitions 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 341a00f15d..e5d4956db9 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/stubs/class.md +++ b/crates/red_knot_python_semantic/resources/mdtest/stubs/class.md @@ -17,7 +17,7 @@ reveal_type(Bar) # revealed: Literal[Bar] reveal_type(Bar.__mro__) # revealed: tuple[Literal[Bar], Literal[Foo], Literal[object]] ``` -## Access to attributes declarated in stubs +## Access to attributes declared in stubs Unlike regular Python modules, stub files often omit the right-hand side in declarations, including in class scope. However, from the perspective of the type checker, we have to treat them as bindings diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/message.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/message.pyi index ebad05a1cf..8993a32171 100644 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/message.pyi +++ b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/message.pyi @@ -153,7 +153,7 @@ class MIMEPart(Message[_HeaderRegistryT, _HeaderRegistryParamT]): def attach(self, payload: Self) -> None: ... # type: ignore[override] # The attachments are created via type(self) in the attach method. It's theoretically # possible to sneak other attachment types into a MIMEPart instance, but could cause - # cause unforseen consequences. + # cause unforeseen consequences. def iter_attachments(self) -> Iterator[Self]: ... def iter_parts(self) -> Iterator[MIMEPart[_HeaderRegistryT]]: ... def get_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> Any: ... diff --git a/crates/ruff_benchmark/resources/large/dataset.py b/crates/ruff_benchmark/resources/large/dataset.py index e53287e619..2e011dcbfc 100644 --- a/crates/ruff_benchmark/resources/large/dataset.py +++ b/crates/ruff_benchmark/resources/large/dataset.py @@ -197,7 +197,7 @@ def test_index_with_attribute(): ds["Foo"] = ds.Foo + 2.0 assert ( ds["Foo"] is ds.Foo - ) # This is now modfied, but both methods points to the same object + ) # This is now modified, but both methods points to the same object def test_getitem_time(ds3): diff --git a/crates/ruff_formatter/src/printer/mod.rs b/crates/ruff_formatter/src/printer/mod.rs index 3881e14d70..4b7f7db998 100644 --- a/crates/ruff_formatter/src/printer/mod.rs +++ b/crates/ruff_formatter/src/printer/mod.rs @@ -894,7 +894,7 @@ struct PrinterState<'a> { line_suffixes: LineSuffixes<'a>, verbatim_markers: Vec, group_modes: GroupModes, - // Re-used queue to measure if a group fits. Optimisation to avoid re-allocating a new + // Reused queue to measure if a group fits. Optimisation to avoid re-allocating a new // vec every time a group gets measured fits_stack: Vec, fits_queue: Vec>, diff --git a/crates/ruff_linter/src/rules/pyflakes/mod.rs b/crates/ruff_linter/src/rules/pyflakes/mod.rs index 79b1279446..717821e95f 100644 --- a/crates/ruff_linter/src/rules/pyflakes/mod.rs +++ b/crates/ruff_linter/src/rules/pyflakes/mod.rs @@ -3124,7 +3124,7 @@ lambda: fu #[test] fn redefined_by_gen_exp() { - // Re-using a global name as the loop variable for a generator + // Reusing a global name as the loop variable for a generator // expression results in a redefinition warning. flakes( "import fu; (1 for fu in range(1))",