Skip to content

Commit

Permalink
Add typos to CI (#1036)
Browse files Browse the repository at this point in the history
* fix CI

* Run all checks on push to main

* Add typos to CI
  • Loading branch information
jayvdb authored Sep 9, 2024
1 parent fcdb5db commit 9d778b0
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 19 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ jobs:
if [[ ${{ steps.changes.outputs.changes }} == true ]]; then
./scripts/test.sh ${{ matrix.crate }}
fi
check-typos:
name: typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: taiki-e/install-action@v2
with:
tool: typos
- run: typos

test-examples-compile:
name: "test (examples)"
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-swagger-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -eu -o pipefail

version="${1:-""}"
if [ -z "$version" ]; then
echo "Missing 'version' argument from commmand, run as $0 <version>" >&2 && exit 1
echo "Missing 'version' argument from command, run as $0 <version>" >&2 && exit 1
fi
zip_name="v$version.zip"

Expand Down
4 changes: 2 additions & 2 deletions utoipa-axum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ use utoipa::openapi::HttpMethod;
/// Extends [`utoipa::openapi::path::PathItem`] by providing conversion methods to convert this
/// path item type to a [`axum::routing::MethodFilter`].
pub trait PathItemExt {
/// Convert this path item type ot a [`axum::routing::MethodFilter`].
/// Convert this path item type to a [`axum::routing::MethodFilter`].
///
/// Method filter is used with handler registration on [`axum::routing::MethodRouter`].
fn to_method_filter(&self) -> MethodFilter;
Expand Down Expand Up @@ -89,7 +89,7 @@ pub use paste::paste;
/// Collect axum handlers annotated with [`utoipa::path`] to [`router::UtoipaMethodRouter`].
///
/// [`routes`] macro will return [`router::UtoipaMethodRouter`] which contains an
/// [`axum::routing::MethodRouter`] and currenty registered paths. The output of this macro is
/// [`axum::routing::MethodRouter`] and currently registered paths. The output of this macro is
/// meant to be used together with [`router::OpenApiRouter`] which combines the paths and axum
/// routers to a single entity.
///
Expand Down
2 changes: 1 addition & 1 deletion utoipa-gen/src/component/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ mod tests {
..Default::default()
};

let result = parse_container(attributes).expect("parse succes");
let result = parse_container(attributes).expect("parse success");
assert_eq!(expected, result);
}
}
2 changes: 1 addition & 1 deletion utoipa-gen/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl<'t> From<TypeTree<'t>> for RequestBody<'t> {
impl ToTokensDiagnostics for RequestBody<'_> {
fn to_tokens(&self, tokens: &mut TokenStream) -> Result<(), Diagnostics> {
let mut actual_body = get_actual_body_type(&self.ty)
.expect("should have found actual requst body TypeTree")
.expect("should have found actual request body TypeTree")
.clone();

if let Some(option) = find_option_type_tree(&self.ty) {
Expand Down
4 changes: 2 additions & 2 deletions utoipa-gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,7 @@ pub fn path(attr: TokenStream, item: TokenStream) -> TokenStream {
/// generated from Cargo environment variables. **Note!** Defined attributes will override the
/// whole attribute from generated values of Cargo environment variables. E.g. defining
/// `contact(name = ...)` will ultimately override whole contact of info and not just partially
/// the name. See [info attribute sytnax][info_syntax]
/// the name. See [info attribute syntax][info_syntax]
/// * `nest(...)` Allows nesting [`OpenApi`][openapi_struct]s to this _`OpenApi`_ instance. Nest
/// takes comma separated list of tuples of nested `OpenApi`s. _`OpenApi`_ instance must
/// implement [`OpenApi`][openapi] trait. Nesting allows defining one `OpenApi` per defined path.
Expand Down Expand Up @@ -1563,7 +1563,7 @@ pub fn path(attr: TokenStream, item: TokenStream) -> TokenStream {
/// * `path = ...` Define mandatory path for nesting the [`OpenApi`][openapi_struct].
/// * `api = ...` Define mandatory path to struct that implements [`OpenApi`][openapi] trait.
/// The fully qualified path (_`path::to`_) will become the default _`tag`_ for the nested
/// `OpenApi` enpoints if provided.
/// `OpenApi` endpoints if provided.
/// * `tags = [...]` Define optional tags what are appended to the existing list of tags.
///
/// _**Example of nest definition**_
Expand Down
4 changes: 2 additions & 2 deletions utoipa-gen/src/openapi/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ mod tests {
let author = "";
let contact = Contact::try_from(author.to_string()).unwrap();

assert!(contact.name.is_none(), "Contat name should be empty");
assert!(contact.email.is_none(), "Contat email should be empty");
assert!(contact.name.is_none(), "Contact name should be empty");
assert!(contact.email.is_none(), "Contact email should be empty");
}
}
2 changes: 1 addition & 1 deletion utoipa-gen/tests/path_derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2218,7 +2218,7 @@ fn path_and_nest_with_default_tags_from_path() {
}

#[test]
fn path_and_nest_with_addtional_tags() {
fn path_and_nest_with_additional_tags() {
mod test_path {
#[allow(dead_code)]
#[utoipa::path(get, path = "/test", tag = "this_is_tag", tags = ["additional"])]
Expand Down
2 changes: 1 addition & 1 deletion utoipa-swagger-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ more details at [serve](https://docs.rs/utoipa-swagger-ui/latest/utoipa_swagger_
hassle free.
* **`debug-embed`** Enables `debug-embed` feature on `rust_embed` crate to allow embedding files in debug
builds as well.
* **`reqwest`** Use `reqwest` for downloading Swagger UI accoring to the `SWAGGER_UI_DOWNLOAD_URL` environment
* **`reqwest`** Use `reqwest` for downloading Swagger UI according to the `SWAGGER_UI_DOWNLOAD_URL` environment
variable. This is only enabled by default on _Windows_.
* **`url`** Enabled by default for parsing and encoding the download URL.
* **`vendored`** Enables vendored Swagger UI via `utoipa-swagger-ui-vendored` crate.
Expand Down
2 changes: 1 addition & 1 deletion utoipa-swagger-ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! hassle free.
//! * **`debug-embed`** Enables `debug-embed` feature on `rust_embed` crate to allow embedding files in debug
//! builds as well.
//! * **`reqwest`** Use `reqwest` for downloading Swagger UI accoring to the `SWAGGER_UI_DOWNLOAD_URL` environment
//! * **`reqwest`** Use `reqwest` for downloading Swagger UI according to the `SWAGGER_UI_DOWNLOAD_URL` environment
//! variable. This is only enabled by default on _Windows_.
//! * **`url`** Enabled by default for parsing and encoding the download URL.
//! * **`vendored`** Enables vendored Swagger UI via `utoipa-swagger-ui-vendored` crate.
Expand Down
4 changes: 2 additions & 2 deletions utoipa/src/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ builder! {
/// Schema keyword can be used to override default _`$schema`_ dialect which is by default
/// “<https://spec.openapis.org/oas/3.1/dialect/base>”.
///
/// All the references and invidual files could use their own schema dialect.
/// All the references and individual files could use their own schema dialect.
#[serde(rename = "$schema", default, skip_serializing_if = "String::is_empty")]
pub schema: String,

Expand Down Expand Up @@ -250,7 +250,7 @@ impl OpenApi {
///
/// **If multiple** APIs are being nested with same `path` only the **last** one will be retained.
///
/// Method accpets two arguments, first is the path to prepend .e.g. _`/user`_. Second argument
/// Method accepts two arguments, first is the path to prepend .e.g. _`/user`_. Second argument
/// is the [`OpenApi`] to prepend paths for.
///
/// # Examples
Expand Down
10 changes: 5 additions & 5 deletions utoipa/src/openapi/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ builder! {
/// [RFC 2054, part 6.1](https://tools.ietf.org/html/rfc2045) and [RFC 4648](RFC 2054, part 6.1).
///
/// Typically this is either unset for _`string`_ content types which then uses the content
/// encoding of the underying JSON document. If the content is in _`binary`_ format such as an image or an audio
/// encoding of the underlying JSON document. If the content is in _`binary`_ format such as an image or an audio
/// set it to `base64` to encode it as _`Base64`_.
///
/// See more details at <https://json-schema.org/understanding-json-schema/reference/non_json_data#contentencoding>
Expand Down Expand Up @@ -1313,7 +1313,7 @@ impl RefBuilder {
set_value!(self ref_location format!("#/components/schemas/{}", schema_name.into()))
}

// TODO: REMOVE THE unnecesary description Option wrapping.
// TODO: REMOVE THE unnecessary description Option wrapping.

/// Add or change description which by default should override that of the referenced component.
/// Description supports markdown syntax. If referenced object type does not support
Expand Down Expand Up @@ -1632,7 +1632,7 @@ pub enum SchemaType {
Type(Type),
/// Multiple types rendered as [`slice`]
Array(Vec<Type>),
/// Type that is considred typeless. _`AnyValue`_ will omit the type definition from the schema
/// Type that is considered typeless. _`AnyValue`_ will omit the type definition from the schema
/// making it to accept any type possible.
AnyValue,
}
Expand All @@ -1658,7 +1658,7 @@ impl FromIterator<Type> for SchemaType {
impl SchemaType {
/// Instantiate new [`SchemaType`] of given [`Type`]
///
/// Method accpets one argument `type` to create [`SchemaType`] for.
/// Method accepts one argument `type` to create [`SchemaType`] for.
///
/// # Examples
///
Expand Down Expand Up @@ -1690,7 +1690,7 @@ impl SchemaType {
///
/// [`Type`] is used to create a [`SchemaType`] that defines the type of the [`Schema`].
/// [`SchemaType`] can be created from a single [`Type`] or multiple [`Type`]s according to the
/// OpenAPI 3.1 spec. Since the OpenAPI 3.1 is fully compatible with JSON schema the definiton of
/// OpenAPI 3.1 spec. Since the OpenAPI 3.1 is fully compatible with JSON schema the definition of
/// the _**type**_ property comes from [JSON Schema type](https://json-schema.org/understanding-json-schema/reference/type).
///
/// # Examples
Expand Down

0 comments on commit 9d778b0

Please sign in to comment.