Pre-commit hook to catch Validate() middleware functions being silently skipped
#2095
echarrod
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Encore's validate feature, where a:
function is automatically is run by the middleware is very cool, but unfortunately it silently fails if the validate receiver function is a pointer, and the object passed to the API definition isn't (and vice versa) (from this Discord thread)
I wrote a pre-commit hook to try to catch this, as it unfortunately fails silently, so it might only be possible to tell if you write a test that you expect to fail, but it doesn't!
Script:
Add to your pre-commit config:
Beta Was this translation helpful? Give feedback.
All reactions