Closed ccamel closed 1 month ago
Attention: Patch coverage is 95.23810%
with 3 lines
in your changes missing coverage. Please review.
Files with missing lines | Patch % | Lines |
---|---|---|
x/logic/predicate/json.go | 95.08% | 2 Missing and 1 partial :warning: |
@@ Coverage Diff @@
## main #778 +/- ##
==========================================
+ Coverage 55.42% 55.55% +0.12%
==========================================
Files 73 73
Lines 2966 2970 +4
==========================================
+ Hits 1644 1650 +6
+ Misses 1228 1227 -1
+ Partials 94 93 -1
Files with missing lines | Coverage Ξ | |
---|---|---|
x/logic/prolog/byte.go | 11.11% <100.00%> (+11.11%) |
:arrow_up: |
x/logic/predicate/json.go | 87.20% <95.08%> (+1.83%) |
:arrow_up: |
[!NOTE]
Reviews paused
Use the following commands to manage reviews:
@coderabbitai resume
to resume automatic reviews.@coderabbitai review
to trigger a single review.
The changes involve significant updates to the JSON and Prolog integration within the predicate/json.go
and json_test.go
files. Key modifications include renaming and altering method signatures to enhance functionality and clarity, particularly in handling Prolog terms and JSON conversions. A new function, BytesToAtom
, has been introduced in byte.go
to convert byte slices into Prolog atoms. The test cases have also been refined for better accuracy and clarity, ensuring they align with the updated functionality.
File | Change Summary |
---|---|
x/logic/predicate/json.go | - Renamed jsonStringToTerms to decodeJSONToTerm , updated its signature to accept engine.Term . - Renamed termsToJSON to encodeTermToJSON , updated its signature. - Renamed jsonToTerms to jsonToTerm , adjusted internal logic. - Added termToJSON for specific Prolog term to JSON conversion. - Refined compoundToJSON for better handling of Prolog compound terms. |
x/logic/predicate/json_test.go | - Updated test case descriptions for clarity. - Added new test cases for JSON object strings. - Refined handling of numeric values and updated expected results. - Adjusted error messages and handling for boolean and null values. |
x/logic/prolog/byte.go | - Added BytesToAtom function to convert []byte to engine.Atom . |
π° In the garden where logic blooms,
JSON dances, dispelling glooms.
Prolog terms in harmony play,
With bytes transformed in a delightful way!
Clarity shines in tests anew,
Hopping forward, we bid adieu! πΌ
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@coderabbitai pause
I was wondering about the handling of higher precisions and I think we'll need to provide string conversion predicates for such needs, what do you think?
Yeah, thatβs a great idea! I totally agree that adding conversion predicates to handle those cases makes sense.
I was wondering about the handling of higher precisions and I think we'll need to provide string conversion predicates for such needs, what do you think?
@coderabbitai, could you please open a new issue to explore the implementation of string/float conversion predicates, as suggested by @amimart? Thanks!
[!TIP] For best results, initiate chat on the files or code changes.
@ccamel, I've opened a new issue to explore the implementation of string/float conversion predicates, as suggested by @amimart. You can find it here: https://github.com/axone-protocol/axoned/issues/781.
This PR introduces two main features:
engine.Float
type. As the underlying type relies on apd -introduced in PR #1- it provides a robust mechanism for handling numbers.Summary by CodeRabbit
New Features
Bug Fixes
Tests