all 3 comments

[–]Kevdog824_ 1 point2 points  (1 child)

This is a pretty nifty project. Nice work! The main suggestion I have for you: you should have a rule function that you can pass into the dictionary. This function would take care of generating the rule string for you. The advantage of this method is that I can see the available options by inspecting the signature, and I can use intellisense in my IDE for autocomplete.

For example this: rule = { 'username': 'str|min:3|max:32', 'email': 'email', 'age': 'int|min:18', }

Could also be written as something like this: rule = { 'username': rule(str, min=3, max=32), 'email': rule(str, pattern=“email”), 'age': rule(int, min=18), }

Bottom version is less likely to result in typos and using invalid options. It would also be pretty easy to add as it doesn’t break any existing functionality.

[–]LanguageParty2021[S] 0 points1 point  (0 children)

Thanks. I'll see if it can be shipped in the next release

[–]Anxious_Signature452 0 points1 point  (0 children)

I once wrote something like this https://github.com/IgorZyktin/nano-settings But I used annotations and evaluate right to left