spikard 0.8.2 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/ext/spikard_rb/Cargo.lock +6 -6
  3. data/ext/spikard_rb/Cargo.toml +1 -1
  4. data/lib/spikard/version.rb +1 -1
  5. data/vendor/crates/spikard-bindings-shared/Cargo.toml +9 -1
  6. data/vendor/crates/spikard-bindings-shared/src/config_extractor.rs +61 -23
  7. data/vendor/crates/spikard-bindings-shared/src/conversion_traits.rs +16 -0
  8. data/vendor/crates/spikard-bindings-shared/src/di_traits.rs +1 -1
  9. data/vendor/crates/spikard-bindings-shared/src/error_response.rs +22 -19
  10. data/vendor/crates/spikard-bindings-shared/src/grpc_metadata.rs +14 -12
  11. data/vendor/crates/spikard-bindings-shared/src/handler_base.rs +15 -6
  12. data/vendor/crates/spikard-bindings-shared/src/lifecycle_base.rs +6 -0
  13. data/vendor/crates/spikard-bindings-shared/src/lifecycle_executor.rs +42 -36
  14. data/vendor/crates/spikard-bindings-shared/src/response_builder.rs +6 -1
  15. data/vendor/crates/spikard-bindings-shared/src/test_client_base.rs +18 -6
  16. data/vendor/crates/spikard-bindings-shared/src/validation_helpers.rs +28 -10
  17. data/vendor/crates/spikard-core/Cargo.toml +9 -1
  18. data/vendor/crates/spikard-core/src/bindings/response.rs +6 -9
  19. data/vendor/crates/spikard-core/src/debug.rs +2 -2
  20. data/vendor/crates/spikard-core/src/di/container.rs +1 -1
  21. data/vendor/crates/spikard-core/src/di/error.rs +1 -1
  22. data/vendor/crates/spikard-core/src/di/factory.rs +7 -3
  23. data/vendor/crates/spikard-core/src/di/graph.rs +1 -0
  24. data/vendor/crates/spikard-core/src/di/resolved.rs +23 -0
  25. data/vendor/crates/spikard-core/src/di/value.rs +1 -0
  26. data/vendor/crates/spikard-core/src/errors.rs +3 -0
  27. data/vendor/crates/spikard-core/src/http.rs +19 -18
  28. data/vendor/crates/spikard-core/src/lifecycle.rs +42 -18
  29. data/vendor/crates/spikard-core/src/parameters.rs +61 -35
  30. data/vendor/crates/spikard-core/src/problem.rs +18 -4
  31. data/vendor/crates/spikard-core/src/request_data.rs +9 -8
  32. data/vendor/crates/spikard-core/src/router.rs +20 -6
  33. data/vendor/crates/spikard-core/src/schema_registry.rs +23 -8
  34. data/vendor/crates/spikard-core/src/type_hints.rs +11 -5
  35. data/vendor/crates/spikard-core/src/validation/error_mapper.rs +29 -15
  36. data/vendor/crates/spikard-core/src/validation/mod.rs +45 -32
  37. data/vendor/crates/spikard-http/Cargo.toml +8 -1
  38. data/vendor/crates/spikard-rb/Cargo.toml +9 -1
  39. data/vendor/crates/spikard-rb/build.rs +1 -0
  40. data/vendor/crates/spikard-rb/src/lib.rs +58 -0
  41. data/vendor/crates/spikard-rb/src/lifecycle.rs +2 -2
  42. data/vendor/crates/spikard-rb-macros/Cargo.toml +9 -1
  43. data/vendor/crates/spikard-rb-macros/src/lib.rs +4 -5
  44. metadata +1 -1
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "spikard-http"
3
- version = "0.8.2"
3
+ version = "0.8.3"
4
4
  edition = "2024"
5
5
  authors = ["Na'aman Hirschfeld <nhirschfeld@gmail.com>"]
6
6
  license = "MIT"
@@ -55,6 +55,13 @@ prost = "0.14"
55
55
  prost-types = "0.14"
56
56
  h2 = "0.4"
57
57
 
58
+ [lints.rust]
59
+ unexpected_cfgs = { level = "allow", check-cfg = ['cfg(tarpaulin_include)'] }
60
+
61
+ [lints.clippy]
62
+ all = { level = "deny", priority = 0 }
63
+ pedantic = { level = "deny", priority = 0 }
64
+ nursery = { level = "deny", priority = 0 }
58
65
 
59
66
  [features]
60
67
  default = []
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "spikard-rb"
3
- version = "0.8.2"
3
+ version = "0.8.3"
4
4
  edition = "2024"
5
5
  authors = ["Na'aman Hirschfeld <nhirschfeld@gmail.com>"]
6
6
  license = "MIT"
@@ -16,6 +16,14 @@ build = "build.rs"
16
16
  [lib]
17
17
  name = "spikard_rb_core"
18
18
 
19
+ [lints.rust]
20
+ unexpected_cfgs = { level = "allow", check-cfg = ['cfg(tarpaulin_include)'] }
21
+
22
+ [lints.clippy]
23
+ all = { level = "deny", priority = 0 }
24
+ pedantic = { level = "deny", priority = 0 }
25
+ nursery = { level = "deny", priority = 0 }
26
+
19
27
  [dependencies]
20
28
  magnus = { version = "0.8.2", features = ["rb-sys", "embed"] }
21
29
  serde = { version = "1.0", features = ["derive"] }
@@ -20,6 +20,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
20
20
  Ok(())
21
21
  }
22
22
 
23
+ #[allow(clippy::too_many_lines)]
23
24
  fn generated_response_file() -> String {
24
25
  r##"# frozen_string_literal: true
25
26
 
@@ -1,5 +1,63 @@
1
1
  #![allow(deprecated)]
2
2
  #![deny(clippy::unwrap_used)]
3
+ #![allow(clippy::similar_names)] // Common in FFI code
4
+ #![allow(clippy::missing_errors_doc)] // Many FFI functions return Result
5
+ #![allow(clippy::doc_markdown)] // FFI types don't need backticks
6
+ #![allow(clippy::missing_const_for_fn)] // FFI functions can't be const
7
+ #![allow(clippy::too_many_arguments)] // FFI bridge functions often need many parameters
8
+ #![allow(clippy::too_many_lines)] // FFI wrappers accumulate code
9
+ #![allow(clippy::unused_self)] // Magnus methods may not use self
10
+ #![allow(clippy::unnecessary_wraps)] // Magnus patterns require Result wrappers
11
+ #![allow(clippy::must_use_candidate)] // FFI constructors follow Rust patterns
12
+ #![allow(clippy::struct_excessive_bools)] // FFI configs use multiple bools
13
+ #![allow(clippy::fn_params_excessive_bools)] // FFI builders pass multiple bools
14
+ #![allow(clippy::items_after_statements)] // Common in Rust code
15
+ #![allow(clippy::if_not_else)] // FFI code style preference
16
+ #![allow(clippy::redundant_clone)] // May be necessary in FFI boundary
17
+ #![allow(clippy::uninlined_format_args)] // FFI error messages
18
+ #![allow(clippy::cognitive_complexity)] // FFI handlers have complex logic
19
+ #![allow(clippy::cast_lossless)] // Type conversions in FFI
20
+ #![allow(clippy::option_if_let_else)] // FFI error handling patterns
21
+ #![allow(clippy::missing_panics_doc)] // Runtime server panics acceptable in server context
22
+ #![allow(clippy::unused_async)] // Async trait methods may not await
23
+ #![allow(clippy::non_std_lazy_statics)] // using_once_cell pattern
24
+ #![allow(clippy::ptr_as_ptr)] // Raw pointer casts in FFI code
25
+ #![allow(clippy::ptr_cast_constness)] // Cast constness for FFI interop
26
+ #![allow(clippy::significant_drop_tightening)] // Drop timing in FFI bridges
27
+ #![allow(clippy::trivially_copy_pass_by_ref)] // FFI compatibility
28
+ #![allow(clippy::cast_possible_wrap)] // Cast wrapping in FFI
29
+ #![allow(clippy::cast_possible_truncation)] // Type size differences in FFI
30
+ #![allow(clippy::used_underscore_binding)] // Internal FFI code
31
+ #![allow(clippy::redundant_closure)] // FFI closure patterns
32
+ #![allow(clippy::explicit_iter_loop)] // FFI iteration style
33
+ #![allow(clippy::cast_sign_loss)] // Unsigned/signed casts in FFI
34
+ #![allow(clippy::map_unwrap_or)] // Idiomatic Option/Result handling
35
+ #![allow(clippy::implicit_clone)] // String conversions in FFI
36
+ #![allow(clippy::ref_option_ref)] // Reference patterns in FFI
37
+ #![allow(clippy::should_implement_trait)] // FFI trait implementation
38
+ #![allow(clippy::match_like_matches_macro)] // FFI match patterns
39
+ #![allow(clippy::match_bool)] // Boolean matching in FFI
40
+ #![allow(clippy::format_push_string)] // String formatting in FFI
41
+ #![allow(clippy::option_option)] // Option nesting in FFI
42
+ #![allow(clippy::enum_variant_names)] // FFI variant naming
43
+ #![allow(clippy::identity_op)] // FFI operations
44
+ #![allow(clippy::filter_next)] // Filter operations in FFI
45
+ #![allow(clippy::manual_let_else)] // Let-else patterns in FFI
46
+ #![allow(clippy::if_then_some_else_none)] // If-then-some patterns
47
+ #![allow(clippy::clone_on_copy)] // Clone on copy types in FFI
48
+ #![allow(clippy::unit_arg)] // Unit argument handling
49
+ #![allow(clippy::impl_trait_in_params)] // Trait parameters in FFI
50
+ #![allow(clippy::match_same_arms)] // Identical match arms
51
+ #![allow(clippy::needless_pass_by_value)] // FFI argument passing style
52
+ #![allow(clippy::ref_as_ptr)] // Explicit pointer casts in FFI
53
+ #![allow(clippy::while_let_on_iterator)] // Iterator patterns in FFI
54
+ #![allow(clippy::redundant_closure_for_method_calls)] // Closure patterns in FFI
55
+ #![allow(clippy::as_ptr_cast_mut)] // Raw pointer casting in FFI
56
+ #![allow(clippy::match_wildcard_for_single_variants)] // Wildcard patterns in FFI
57
+ #![allow(clippy::ignored_unit_patterns)] // Unit pattern handling in FFI
58
+ #![allow(clippy::option_as_ref_deref)] // Option reference patterns
59
+ #![allow(clippy::semicolon_if_nothing_returned)] // Return statement consistency
60
+ #![allow(clippy::map_identity)] // Identity mapping patterns
3
61
 
4
62
  //! Spikard Ruby bindings using Magnus FFI.
5
63
  //!
@@ -47,7 +47,7 @@ impl LifecycleHook<Request<Body>, Response<Body>> for RubyLifecycleHook {
47
47
  }
48
48
 
49
49
  fn execute_request<'a>(
50
- &'a self,
50
+ &self,
51
51
  req: Request<Body>,
52
52
  ) -> Pin<Box<dyn Future<Output = Result<HookResult<Request<Body>, Response<Body>>, String>> + Send + 'a>> {
53
53
  let func = self.func;
@@ -174,7 +174,7 @@ impl LifecycleHook<Request<Body>, Response<Body>> for RubyLifecycleHook {
174
174
  }
175
175
 
176
176
  fn execute_response<'a>(
177
- &'a self,
177
+ &self,
178
178
  resp: Response<Body>,
179
179
  ) -> Pin<Box<dyn Future<Output = Result<HookResult<Response<Body>, Response<Body>>, String>> + Send + 'a>> {
180
180
  let func = self.func;
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "spikard-rb-macros"
3
- version = "0.8.2"
3
+ version = "0.8.3"
4
4
  edition = "2024"
5
5
  license = "MIT"
6
6
  publish = false
@@ -8,6 +8,14 @@ publish = false
8
8
  [lib]
9
9
  proc-macro = true
10
10
 
11
+ [lints.rust]
12
+ unexpected_cfgs = { level = "allow", check-cfg = ['cfg(tarpaulin_include)'] }
13
+
14
+ [lints.clippy]
15
+ all = { level = "deny", priority = 0 }
16
+ pedantic = { level = "deny", priority = 0 }
17
+ nursery = { level = "deny", priority = 0 }
18
+
11
19
  [dependencies]
12
20
  proc-macro2 = "1"
13
21
  quote = "1"
@@ -20,11 +20,10 @@ pub fn without_gvl(_attr: TokenStream, item: TokenStream) -> TokenStream {
20
20
  FnArg::Receiver(recv) => {
21
21
  let ty = if let Some((_and, lifetime)) = &recv.reference {
22
22
  let mutability = recv.mutability;
23
- if let Some(lifetime) = lifetime {
24
- quote!(&#lifetime #mutability Self)
25
- } else {
26
- quote!(& #mutability Self)
27
- }
23
+ lifetime.as_ref().map_or_else(
24
+ || quote!(& #mutability Self),
25
+ |lifetime| quote!(&#lifetime #mutability Self),
26
+ )
28
27
  } else {
29
28
  quote!(Self)
30
29
  };
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spikard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Na'aman Hirschfeld