-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
add play.api.Configuration#load to the public API
#8138
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
Conversation
Allows for clients which don't require a configuration to be defined.
octonato
left a comment
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, @erip for jumping into it.
| directSettings: Map[String, AnyRef], | ||
| allowMissingApplicationConf: Boolean): Configuration = { | ||
| def load(classLoader: ClassLoader, properties: Properties, directSettings: Map[String, AnyRef], | ||
| allowMissingApplicationConf: Boolean): Configuration = { |
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.
@erip The build is broken because of scalariform formatting.
Scalariform wants it to be formatted as:
def load(classLoader: ClassLoader, properties: Properties, directSettings: Map[String, AnyRef],
allowMissingApplicationConf: Boolean): ConfigurationI also prefer formatting aligned with the first opening parenthesis, but between what Scalariform is requiring and the previous format, I think it's preferable to have all arguments aligned on the same column.
The advantage of column alignment is that the human eyes can parse a break-line much easier than a comma. So we can easily distinguish all the arguments and we don't need to parse the line for commas.
My 2cc. :-)
|
@renatocaval thanks for checking. I commited and went to sleep so I didn't see the failure until this morning. 😅 Because these commits are small, I've just been doing them from github's ui... Will the commits be squashed automatically? |
|
yes, they will be squashed. However, I'm not sure it will pass scalariform. I think you can't align using the open parenthesis. Maybe I was not clear about it. I do prefer to align it on the parenthesis, but scalariform puts on the next line with indentation 2. |
|
You can cherrypick the latest commit if you want this PR... only thing that changes is indentation between all commits. |
* add `play.api.Configuration#load` to the public API Allows for clients which don't require a configuration to be defined. * fixes style * fix style * fix style
|
I backported this to 2.6.x: ff2df6b |
|
Thanks so much, @gmethvin. 👍 |
In Lagom, clients require an
application.conflest an exception be thrown.To mitigate this, passing
allowMissingApplicationConftoConfiguration#loadwould be perfect. Unfortunately, it is only part of the private API.This PR adds
Configuration#load(withallowMissingApplicationConf) to the public API.