mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 11:59:10 +00:00
Fixing various spelling errors (#16924)
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary This is a cleanup PR. I am fixing various English language spelling errors. This is mostly in docs and docstrings. ## Test Plan The usual CI tests were run. I tried to build the docs (though I had some troubles there). The testing needs here are, I trust, very low impact. (Though I would happily test more.)
This commit is contained in:
parent
7fb765d9b6
commit
c35f2bfe32
11 changed files with 20 additions and 20 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -1421,11 +1421,11 @@ The following rules have been stabilized and are no longer in preview:
|
||||||
|
|
||||||
The following behaviors have been stabilized:
|
The following behaviors have been stabilized:
|
||||||
|
|
||||||
- [`cancel-scope-no-checkpoint`](https://docs.astral.sh/ruff/rules/cancel-scope-no-checkpoint/) (`ASYNC100`): Support `asyncio` and `anyio` context mangers.
|
- [`cancel-scope-no-checkpoint`](https://docs.astral.sh/ruff/rules/cancel-scope-no-checkpoint/) (`ASYNC100`): Support `asyncio` and `anyio` context managers.
|
||||||
- [`async-function-with-timeout`](https://docs.astral.sh/ruff/rules/async-function-with-timeout/) (`ASYNC109`): Support `asyncio` and `anyio` context mangers.
|
- [`async-function-with-timeout`](https://docs.astral.sh/ruff/rules/async-function-with-timeout/) (`ASYNC109`): Support `asyncio` and `anyio` context managers.
|
||||||
- [`async-busy-wait`](https://docs.astral.sh/ruff/rules/async-busy-wait/) (`ASYNC110`): Support `asyncio` and `anyio` context mangers.
|
- [`async-busy-wait`](https://docs.astral.sh/ruff/rules/async-busy-wait/) (`ASYNC110`): Support `asyncio` and `anyio` context managers.
|
||||||
- [`async-zero-sleep`](https://docs.astral.sh/ruff/rules/async-zero-sleep/) (`ASYNC115`): Support `anyio` context mangers.
|
- [`async-zero-sleep`](https://docs.astral.sh/ruff/rules/async-zero-sleep/) (`ASYNC115`): Support `anyio` context managers.
|
||||||
- [`long-sleep-not-forever`](https://docs.astral.sh/ruff/rules/long-sleep-not-forever/) (`ASYNC116`): Support `anyio` context mangers.
|
- [`long-sleep-not-forever`](https://docs.astral.sh/ruff/rules/long-sleep-not-forever/) (`ASYNC116`): Support `anyio` context managers.
|
||||||
|
|
||||||
The following fixes have been stabilized:
|
The following fixes have been stabilized:
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ try:
|
||||||
help()
|
help()
|
||||||
except* OSError as e:
|
except* OSError as e:
|
||||||
# TODO: more precise would be `ExceptionGroup[OSError]` --Alex
|
# TODO: more precise would be `ExceptionGroup[OSError]` --Alex
|
||||||
# (needs homogenous tuples + generics)
|
# (needs homogeneous tuples + generics)
|
||||||
reveal_type(e) # revealed: BaseExceptionGroup
|
reveal_type(e) # revealed: BaseExceptionGroup
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ try:
|
||||||
help()
|
help()
|
||||||
except* (TypeError, AttributeError) as e:
|
except* (TypeError, AttributeError) as e:
|
||||||
# TODO: more precise would be `ExceptionGroup[TypeError | AttributeError]` --Alex
|
# TODO: more precise would be `ExceptionGroup[TypeError | AttributeError]` --Alex
|
||||||
# (needs homogenous tuples + generics)
|
# (needs homogeneous tuples + generics)
|
||||||
reveal_type(e) # revealed: BaseExceptionGroup
|
reveal_type(e) # revealed: BaseExceptionGroup
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ Using a parameter with default value:
|
||||||
lambda x=1: reveal_type(x) # revealed: Unknown | Literal[1]
|
lambda x=1: reveal_type(x) # revealed: Unknown | Literal[1]
|
||||||
```
|
```
|
||||||
|
|
||||||
Using a variadic paramter:
|
Using a variadic parameter:
|
||||||
|
|
||||||
```py
|
```py
|
||||||
# TODO: should be `tuple[Unknown, ...]` (needs generics)
|
# TODO: should be `tuple[Unknown, ...]` (needs generics)
|
||||||
|
|
|
@ -17,7 +17,7 @@ use ruff_db::parsed::ParsedModule;
|
||||||
/// ## Usage in salsa tracked structs
|
/// ## Usage in salsa tracked structs
|
||||||
/// It's important that [`AstNodeRef`] fields in salsa tracked structs are tracked fields
|
/// It's important that [`AstNodeRef`] fields in salsa tracked structs are tracked fields
|
||||||
/// (attributed with `#[tracked`]). It prevents that the tracked struct gets a new ID
|
/// (attributed with `#[tracked`]). It prevents that the tracked struct gets a new ID
|
||||||
/// everytime the AST changes, which in turn, invalidates the result of any query
|
/// every time the AST changes, which in turn, invalidates the result of any query
|
||||||
/// that takes said tracked struct as a query argument or returns the tracked struct as part of its result.
|
/// that takes said tracked struct as a query argument or returns the tracked struct as part of its result.
|
||||||
///
|
///
|
||||||
/// For example, marking the [`AstNodeRef`] as tracked on `Expression`
|
/// For example, marking the [`AstNodeRef`] as tracked on `Expression`
|
||||||
|
|
|
@ -667,7 +667,7 @@ impl<'db> Type<'db> {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
// A fully static heterogenous tuple type `A` is a subtype of a fully static heterogeneous tuple type `B`
|
// A fully static heterogeneous tuple type `A` is a subtype of a fully static heterogeneous tuple type `B`
|
||||||
// iff the two tuple types have the same number of elements and each element-type in `A` is a subtype
|
// iff the two tuple types have the same number of elements and each element-type in `A` is a subtype
|
||||||
// of the element-type at the same index in `B`. (Now say that 5 times fast.)
|
// of the element-type at the same index in `B`. (Now say that 5 times fast.)
|
||||||
//
|
//
|
||||||
|
@ -687,7 +687,7 @@ impl<'db> Type<'db> {
|
||||||
// Other than the special tuple-to-tuple case handled, above,
|
// Other than the special tuple-to-tuple case handled, above,
|
||||||
// tuple subtyping delegates to `Instance(tuple)` in the same way as the literal types.
|
// tuple subtyping delegates to `Instance(tuple)` in the same way as the literal types.
|
||||||
//
|
//
|
||||||
// All heterogenous tuple types are subtypes of `Instance(<tuple>)`:
|
// All heterogeneous tuple types are subtypes of `Instance(<tuple>)`:
|
||||||
// `Instance(<some class T>)` expresses "the set of all possible instances of the class `T`";
|
// `Instance(<some class T>)` expresses "the set of all possible instances of the class `T`";
|
||||||
// consequently, `Instance(<tuple>)` expresses "the set of all possible instances of the class `tuple`".
|
// consequently, `Instance(<tuple>)` expresses "the set of all possible instances of the class `tuple`".
|
||||||
// This type can be spelled in type annotations as `tuple[object, ...]` (since `tuple` is covariant).
|
// This type can be spelled in type annotations as `tuple[object, ...]` (since `tuple` is covariant).
|
||||||
|
@ -1134,7 +1134,7 @@ impl<'db> Type<'db> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// for `type[Any]`/`type[Unknown]`/`type[Todo]`, we know the type cannot be any larger than `type`,
|
// for `type[Any]`/`type[Unknown]`/`type[Todo]`, we know the type cannot be any larger than `type`,
|
||||||
// so although the type is dynamic we can still determine disjointness in some situations
|
// so although the type is dynamic we can still determine disjointedness in some situations
|
||||||
(Type::SubclassOf(subclass_of_ty), other)
|
(Type::SubclassOf(subclass_of_ty), other)
|
||||||
| (other, Type::SubclassOf(subclass_of_ty)) => match subclass_of_ty.subclass_of() {
|
| (other, Type::SubclassOf(subclass_of_ty)) => match subclass_of_ty.subclass_of() {
|
||||||
ClassBase::Dynamic(_) => {
|
ClassBase::Dynamic(_) => {
|
||||||
|
@ -1289,7 +1289,7 @@ impl<'db> Type<'db> {
|
||||||
|
|
||||||
(Type::Callable(CallableType::General(_)), _)
|
(Type::Callable(CallableType::General(_)), _)
|
||||||
| (_, Type::Callable(CallableType::General(_))) => {
|
| (_, Type::Callable(CallableType::General(_))) => {
|
||||||
// TODO: Implement disjointness for general callable types
|
// TODO: Implement disjointedness for general callable types
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -491,7 +491,7 @@ enum DeclaredAndInferredType<'db> {
|
||||||
/// [`TypeInferenceBuilder`] just for that definition, and we merge the returned [`TypeInference`]
|
/// [`TypeInferenceBuilder`] just for that definition, and we merge the returned [`TypeInference`]
|
||||||
/// into the one we are currently building for the entire scope. Using the query in this way
|
/// into the one we are currently building for the entire scope. Using the query in this way
|
||||||
/// ensures that if we first infer types for some scattered definitions in a scope, and later for
|
/// ensures that if we first infer types for some scattered definitions in a scope, and later for
|
||||||
/// the entire scope, we don't re-infer any types, we re-use the cached inference for those
|
/// the entire scope, we don't re-infer any types, we reuse the cached inference for those
|
||||||
/// definitions and their sub-expressions.
|
/// definitions and their sub-expressions.
|
||||||
///
|
///
|
||||||
/// Functions with a name like `infer_*_definition` take both a node and a [`Definition`], and are
|
/// Functions with a name like `infer_*_definition` take both a node and a [`Definition`], and are
|
||||||
|
|
|
@ -266,7 +266,7 @@ mod flaky {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Equal element sets of unions implies equivalence
|
// Equal element sets of unions implies equivalence
|
||||||
// flaky at laest in part because of https://github.com/astral-sh/ruff/issues/15513
|
// flaky at least in part because of https://github.com/astral-sh/ruff/issues/15513
|
||||||
type_property_test!(
|
type_property_test!(
|
||||||
union_equivalence_not_order_dependent, db,
|
union_equivalence_not_order_dependent, db,
|
||||||
forall types s, t, u.
|
forall types s, t, u.
|
||||||
|
|
|
@ -937,7 +937,7 @@ impl From<snippet::Level> for DisplayAnnotationType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Information whether the header is the initial one or a consequitive one
|
/// Information whether the header is the initial one or a consecutive one
|
||||||
/// for multi-slice cases.
|
/// for multi-slice cases.
|
||||||
// TODO: private
|
// TODO: private
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
|
|
@ -85,7 +85,7 @@ def decorator_deprecated_operator_args():
|
||||||
bdow_op >> bdow_op2
|
bdow_op >> bdow_op2
|
||||||
|
|
||||||
|
|
||||||
# deprecated filename_template arugment in FileTaskHandler
|
# deprecated filename_template argument in FileTaskHandler
|
||||||
S3TaskHandler(filename_template="/tmp/test")
|
S3TaskHandler(filename_template="/tmp/test")
|
||||||
HdfsTaskHandler(filename_template="/tmp/test")
|
HdfsTaskHandler(filename_template="/tmp/test")
|
||||||
ElasticsearchTaskHandler(filename_template="/tmp/test")
|
ElasticsearchTaskHandler(filename_template="/tmp/test")
|
||||||
|
|
|
@ -228,7 +228,7 @@ AIR302_args.py:67:9: AIR302 `sla` is removed in Airflow 3.0
|
||||||
|
|
||||||
AIR302_args.py:89:15: AIR302 `filename_template` is removed in Airflow 3.0
|
AIR302_args.py:89:15: AIR302 `filename_template` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
88 | # deprecated filename_template arugment in FileTaskHandler
|
88 | # deprecated filename_template argument in FileTaskHandler
|
||||||
89 | S3TaskHandler(filename_template="/tmp/test")
|
89 | S3TaskHandler(filename_template="/tmp/test")
|
||||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||||
90 | HdfsTaskHandler(filename_template="/tmp/test")
|
90 | HdfsTaskHandler(filename_template="/tmp/test")
|
||||||
|
@ -237,7 +237,7 @@ AIR302_args.py:89:15: AIR302 `filename_template` is removed in Airflow 3.0
|
||||||
|
|
||||||
AIR302_args.py:90:17: AIR302 `filename_template` is removed in Airflow 3.0
|
AIR302_args.py:90:17: AIR302 `filename_template` is removed in Airflow 3.0
|
||||||
|
|
|
|
||||||
88 | # deprecated filename_template arugment in FileTaskHandler
|
88 | # deprecated filename_template argument in FileTaskHandler
|
||||||
89 | S3TaskHandler(filename_template="/tmp/test")
|
89 | S3TaskHandler(filename_template="/tmp/test")
|
||||||
90 | HdfsTaskHandler(filename_template="/tmp/test")
|
90 | HdfsTaskHandler(filename_template="/tmp/test")
|
||||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||||
|
|
|
@ -446,7 +446,7 @@ interface FilesState {
|
||||||
contents: Readonly<{ [id: FileId]: string }>;
|
contents: Readonly<{ [id: FileId]: string }>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The revision. Gets incremented everytime files changes.
|
* The revision. Gets incremented every time files changes.
|
||||||
*/
|
*/
|
||||||
revision: number;
|
revision: number;
|
||||||
nextId: FileId;
|
nextId: FileId;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue