breck7 / scrollsdk

The code for Particles and Parsers, which Scroll is built on.
https://sdk.scroll.pub
383 stars 17 forks source link

HOWTO : Duplicate keys value validation and their dependent keys #155

Closed ghost closed 1 year ago

ghost commented 1 year ago

check the number of keys of the same name in a table and have some validation logic (If some table entry has 2 websites then 2 usernames should be provided)

Can i check if certain keys have different values or same values ( mentioning the same website twice should be an error,etc )

As far as i am aware i have not found any information about how to manage accidental additions (https://prettier.io/) might help a lot in detecting this manually.

breck7 commented 1 year ago

Can i check if certain keys have different values or same values ( mentioning the same website twice should be an error,etc )

Great idea! We should add this to Grammar.

ghost commented 1 year ago

@breck7 adding support for https://github.com/prettier/prettier and then having minimal diff patches seems to be important for working with own tools. Your code reviews have caught this many times, It would be really nice for people like me, if you could have something more simpler than grammar to solve this issue

Context: https://github.com/breck7/pldb/commit/cca4f51c5264de4cbf0fa5c28814ce6d1249a130#r86588860

breck7 commented 1 year ago

This is a great idea @SRS-WRKS !! Lets do it. I can look into it as well if you have other things

celtic-coder commented 1 year ago

These are good suggestions! 👍

ghost commented 1 year ago

@celtic-coder : thank you

@breck7 : We can get this done. I jam just sad that i hadn't found you sooner !!!! , Please bear with me in the short term.

breck7 commented 1 year ago

Added the ability to check for duplicates: 1bceda9a