-
Notifications
You must be signed in to change notification settings - Fork 170
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 rangeLimit to JinjavaConfig (1000 by default) #658
Conversation
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.
A few comments, otherwise looks good. Thanks!
@@ -1,6 +1,8 @@ | |||
package com.hubspot.jinjava.lib.fn; | |||
|
|||
import static com.hubspot.jinjava.interpret.JinjavaInterpreter.getCurrent; |
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.
any reason for the static import here? It's only used once.
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.
Indeed, I remove it
RANGE_LIMIT + | ||
" values.", | ||
DEFAULT_RANGE_LIMIT + | ||
" values by default, but this integer value is configurable.", |
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.
it is configurable, but not by the user which is who this documentation is targeted to.
" values by default, but this integer value is configurable.", | |
" values.", |
params = { | ||
@JinjavaParam(value = "start", type = "number", defaultValue = "0"), | ||
@JinjavaParam(value = "end", type = "number"), | ||
@JinjavaParam(value = "step", type = "number", defaultValue = "1") | ||
} | ||
) | ||
public static List<Integer> range(Object arg1, Object... args) { | ||
int rangeLimit = requireNonNull( | ||
JinjavaInterpreter.getCurrent(), |
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 think it's only possible for this to be null in tests if you forget to push an interpreter onto the stack.
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 remove it, I just don't like when my IDE is screaming at me when something can be null.
27cf68c
to
53cf9c1
Compare
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. Thanks!
Changes: