Repository navigation
feat: added new evaluate command to check the score of the asyncapi document - #1413
Conversation
|
@AayushSaini101 do we need a new command for the linked issue ? |
There was a problem hiding this comment.
@AayushSaini101 check if we can use the new UI library for this (see #1214)
This might be used under |
Agreed, how about adding it as a flag |
|
IMO, I would opt for just adding a flag to |
There was a problem hiding this comment.
Why is it necessary to divide scoreEvaluate by 1? I guess I'm missing something 🤔
There was a problem hiding this comment.
@peter-rr In the initial stage, the total weight of the coefficient is 1 that's why we need to divide the sum by 1, to get 100 Score for a valid asyncapi document.
Evaluation and Validation are closely related, having |
|
/update There are some issues with sonar-cloud as well @AayushSaini101. |
|
@Shurtu-gal @Amzani @Souvikns I have added score flag in the existing validate command, and added a test case to verify the score and command. Ready for review. : ) Thanks |
There was a problem hiding this comment.
Not sure if you need all this code from line 7 to line 24, why you don't just use the exported function available to you in parser.ts
import { parse } from '../parser';
There was a problem hiding this comment.
We already have this logic in src/parser.ts no?
There was a problem hiding this comment.
Reverted thanks
There was a problem hiding this comment.
I suggest to extract the score logic and move it under models or utils for now. It will make this #1200 easy.
There was a problem hiding this comment.
Moved to Utils Thanks
There was a problem hiding this comment.
How about returning the score instead of a log string. As this makes it easier to use later in another scenarios if we want.
There was a problem hiding this comment.
@Shurtu-gal In my opinion, proper logging would be better that enhanve the developer experience as well. @Amzani What do you think on this ?
There was a problem hiding this comment.
Yeah, I am not suggesting to take out the log message, just return the score from this function. And put logging where this function is consumed.
This way this function can be reused if needed.
Shurtu-gal
left a comment
There was a problem hiding this comment.
LGTM from my side. 🚀
Let's wait for @Amzani as well.
Amzani
left a comment
There was a problem hiding this comment.
Great PR! only thing missing for me is describing how score is calculated for users.
There was a problem hiding this comment.
Users might might not understand how score is calculated, could we add more description and details about that ?
12b0927 to
0c3d245
Compare
|
@Shurtu-gal @Amzani Ready for review. Hopefull for the last review cycle :) |
|
/update |
peter-rr
left a comment
There was a problem hiding this comment.
Left a couple of small suggestions :)
| done(); | ||
| }); | ||
| }); | ||
| // The score of the asyncapi document is 50 |
There was a problem hiding this comment.
I guess we can omit this comment and update line 262 with the correct value instead, since that line is already explanatory itself.
Co-authored-by: Pedro Ramos <[email protected]>
|
|
/u |
|
|
/rtm |
|
🎉 This PR is included in version 2.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |




Resolves: #1131