From 5f24efb956e91047db6f47fcd5b169c2d1264602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Augusto=20C=C3=A9sar?= Date: Mon, 29 Jul 2024 14:32:22 +0200 Subject: [PATCH 1/5] fix: doc_lazy_continuation linting issue --- async-stripe/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/async-stripe/src/lib.rs b/async-stripe/src/lib.rs index e4cc7a1db..04550a92a 100644 --- a/async-stripe/src/lib.rs +++ b/async-stripe/src/lib.rs @@ -29,9 +29,9 @@ //! to determine which fields are required for either request. //! //! > **Note:** We have an extensive collection of examples which are interspersed in -//! the documentation. Any time an API is used in an example it is highlighted in the -//! docs for that item. You can also find all the raw examples in the `examples` directory. -//! Please have a look at those for inspiration or ideas on how to get started. +//! > the documentation. Any time an API is used in an example it is highlighted in the +//! > docs for that item. You can also find all the raw examples in the `examples` directory. +//! > Please have a look at those for inspiration or ideas on how to get started. //! //! ## Idempotency / Request Strategies //! @@ -51,7 +51,7 @@ //! generated automatically and is stable across retries. //! //! > Want to implement your own? If it is a common strategy, please consider opening a PR to add it to the library. -//! Otherwise, we are open to turning this into an open trait so that you can implement your own strategy. +//! > Otherwise, we are open to turning this into an open trait so that you can implement your own strategy. #![warn(clippy::missing_errors_doc, clippy::missing_panics_doc)] #![deny(missing_docs, missing_debug_implementations)] From 6791e55dd53dc461c4f53ebb46d786311056b00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Augusto=20C=C3=A9sar?= Date: Mon, 29 Jul 2024 14:32:55 +0200 Subject: [PATCH 2/5] fix: indentation for long lines that are list items --- openapi/src/templates/utils.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openapi/src/templates/utils.rs b/openapi/src/templates/utils.rs index e4e3b3376..a9d6b0d68 100644 --- a/openapi/src/templates/utils.rs +++ b/openapi/src/templates/utils.rs @@ -184,12 +184,20 @@ pub fn write_doc_comment(description: &str, depth: u8) -> String { out.push_str(line); // If an unreasonable line, inject newlines after each sentence } else { + let is_list_item = line.starts_with("* "); + for (i, part) in PERIOD_THEN_WHITESPACE.split(line).enumerate() { if i > 0 { out.push('\n'); } print_indent(&mut out, depth); - out.push_str("/// "); + + if is_list_item && i > 0 { + out.push_str("/// "); + } else { + out.push_str("/// "); + } + out.push_str(part.trim()); if !part.is_empty() && !out.ends_with('.') { out.push('.'); From fae2763c1f2187012a93f47ada91418d0b8c0fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Augusto=20C=C3=A9sar?= Date: Mon, 29 Jul 2024 14:56:37 +0200 Subject: [PATCH 3/5] fix(webhook): linting issues with incomplete Cargo.toml Rust 1.80 enables check cfg by default. This means that it will look for unexpected cfg configs. Currently we are using multiple cfgs that are not defined on the webhook Cargo.toml. This should fix it. --- async-stripe-webhook/Cargo.toml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/async-stripe-webhook/Cargo.toml b/async-stripe-webhook/Cargo.toml index 92c2bcc61..44d1a0848 100644 --- a/async-stripe-webhook/Cargo.toml +++ b/async-stripe-webhook/Cargo.toml @@ -24,13 +24,34 @@ chrono = { version = "0.4", default-features = false, features = ["clock"] } thiserror = "1.0.24" miniserde.workspace = true serde.workspace = true +serde_json = { workspace = true, optional = true } -async-stripe-core = { path = "../generated/async-stripe-core", optional = true } -async-stripe-checkout = { path = "../generated/async-stripe-checkout", optional = true } async-stripe-billing = { path = "../generated/async-stripe-billing", optional = true } +async-stripe-checkout = { path = "../generated/async-stripe-checkout", optional = true } +async-stripe-core = { path = "../generated/async-stripe-core", optional = true } +async-stripe-fraud = { path = "../generated/async-stripe-fraud", optional = true } +async-stripe-misc = { path = "../generated/async-stripe-misc", optional = true } +async-stripe-payment = { path = "../generated/async-stripe-payment", optional = true } +async-stripe-terminal = { path = "../generated/async-stripe-terminal", optional = true } +async-stripe-treasury = { path = "../generated/async-stripe-treasury", optional = true } [dev-dependencies] serde_json.workspace = true +[features] +serialize = ["async-stripe-types/serialize", "async-stripe-shared/serialize"] +deserialize = ["async-stripe-types/deserialize", "async-stripe-shared/deserialize", "dep:serde_json"] + +full = [ + "async-stripe-billing", + "async-stripe-checkout", + "async-stripe-core", + "async-stripe-fraud", + "async-stripe-misc", + "async-stripe-payment", + "async-stripe-terminal", + "async-stripe-treasury", +] + [package.metadata.docs.rs] -features = ["async-stripe-core", "async-stripe-checkout", "async-stripe-billing"] \ No newline at end of file +features = ["full"] From e4db63229fdd1705d0b59c01fb1ae8073256645b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Augusto=20C=C3=A9sar?= Date: Mon, 29 Jul 2024 16:19:03 +0200 Subject: [PATCH 4/5] chore: run openapi for current version --- generated/async-stripe-shared/src/invoice.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generated/async-stripe-shared/src/invoice.rs b/generated/async-stripe-shared/src/invoice.rs index 7996fcac9..8ddc46d12 100644 --- a/generated/async-stripe-shared/src/invoice.rs +++ b/generated/async-stripe-shared/src/invoice.rs @@ -71,7 +71,7 @@ pub struct Invoice { /// /// * `manual`: Unrelated to a subscription, for example, created via the invoice editor. /// * `subscription`: No longer in use. - /// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. + /// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. /// * `subscription_create`: A new subscription was created. /// * `subscription_cycle`: A subscription advanced into a new period. /// * `subscription_threshold`: A subscription reached a billing threshold. @@ -893,7 +893,7 @@ impl serde::Serialize for Invoice { /// /// * `manual`: Unrelated to a subscription, for example, created via the invoice editor. /// * `subscription`: No longer in use. -/// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. +/// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. /// * `subscription_create`: A new subscription was created. /// * `subscription_cycle`: A subscription advanced into a new period. /// * `subscription_threshold`: A subscription reached a billing threshold. From 1b938a98e9afe082e89f6f465630e59149b309f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Augusto=20C=C3=A9sar?= Date: Tue, 30 Jul 2024 16:23:50 +0200 Subject: [PATCH 5/5] fix(webhook): use correct feature flag for testing --- async-stripe-webhook/src/webhook.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/async-stripe-webhook/src/webhook.rs b/async-stripe-webhook/src/webhook.rs index 7ce4a8ecc..f512df7ff 100644 --- a/async-stripe-webhook/src/webhook.rs +++ b/async-stripe-webhook/src/webhook.rs @@ -279,7 +279,7 @@ mod tests { assert_eq!(invoice.quantity, 3); } - #[cfg(feature = "stripe_billing")] + #[cfg(feature = "async-stripe-billing")] #[test] // https://github.com/arlyon/async-stripe/issues/455 fn test_billing_portal_session() {