-
Notifications
You must be signed in to change notification settings - Fork 25
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 a config option to limit the max amount of characters for a value shown in error messages #110
Conversation
Do we have an example for how an error with 150+ characters will look like? |
plugins/nf-schema/src/main/nextflow/validation/config/ValidationConfig.groovy
Outdated
Show resolved
Hide resolved
You can see an error with a shorter max length in the docs. The value will basically be split up with |
…f-schema into fix/map-params-error-value
failUnrecognisedParams = config.failUnrecognisedParams ?: false | ||
failUnrecognisedHeaders = config.failUnrecognisedHeaders ?: false | ||
showHiddenParams = config.showHiddenParams ?: false | ||
maxErrValSize = config.maxErrValSize && config.maxErrValSize >= 1 ? config.maxErrValSize : 150 |
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.
sorry I had a new idea 😅 What do you think if by setting maxErrValSize
to 0 we don't have a maximum?
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.
Maybe -1
might be better for this?
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.
But I like the idea!
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.
ok, -1 sounds better 😄
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.
Thanks :p It's been implemented
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.
👏 LGTM!
Fixes #80
This PR adds the
validation.maxValueLength
option that takes an integer (bigger than or equal to 0) as input and uses this to limit the amount of characters that a value can be in error messages.Example:
with
validation.maxValueLength = 20
Where the original value is 26 characters long (
abcdefghijklmnopqrstuvwxyz
)The default of this option is
150
which should prevent the loss of most data, but I'm of course open to discuss lowering or raising this default