-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ifn? schema #416
Add ifn? schema #416
Conversation
Happy to rebase things and extend this with anything I've missed. There was mention of adding support for |
Oops! I broke the Clojurescript build with some use of
I'll take a look at applying some reader conditionals after lunch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! a small ordering note if you have time for it. Also, please update the README and CHANGELOG of this addition.
Will merge this when the tests pass.
@@ -53,6 +53,7 @@ | |||
(defmethod accept 'sequential? [_ _ _ _] :sequential) | |||
(defmethod accept 'ratio? [_ _ _ _] :int) ;;?? | |||
(defmethod accept 'bytes? [_ _ _ _] :char-sequence) ;;?? | |||
(defmethod accept 'ifn? [_ _ _ _] :ifn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please align all the 'ifn?
mappings after the fn?
in all the relevant places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved any ifn?
code after corresponding fn?
code in both the implementation and tests. If there's any more clean up you'd like me to do, happy to do so.
Thanks for the feedback, @ikitommi! I’ll implement your requested changes and get the build passing very soon. 🙇♂️ |
ClojureScript tests pass for me locally (I ran If there's anything else I can do, please let me know! |
@@ -14,6 +14,10 @@ We use [Break Versioning][breakver]. The version numbers follow a `<major>.<mino | |||
|
|||
Malli is in [alpha](README.md#alpha). | |||
|
|||
## 0.5.0 (2021-04-13) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure what to put here so guessed this would be a minor version bump rather than just a patch.
The date comes across as quite presumptuous of me, and can absolutely be changed! 🙈
(s/validate ifn? 123) | ||
; => false | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure of the best place to add this information. Hope it's okay.
Thanks! |
Thank you, @ikitommi! 🎉 |
As per a thread over on the Clojurians' Slack group, I've teed up a first draft at adding support for
ifn?
in Malli schemas.This is my first time contributing so apologies for any faux pas. I think I've covered all of the bases with transformers, generators, JSON schema, humanized errors, and clj-kondo, but would really appreciate some testing and pointers from the more familiar Malli contributors.
Thank you for sharing this awesome library, and all of the Metosin suite. It's truly awesome stuff!