Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@erip
Copy link
Contributor

@erip erip commented Jan 5, 2018

In Lagom, clients require an application.conf lest an exception be thrown.

To mitigate this, passing allowMissingApplicationConf to Configuration#load would be perfect. Unfortunately, it is only part of the private API.

This PR adds Configuration#load (with allowMissingApplicationConf) to the public API.

Allows for clients which don't require a configuration to be defined.
Copy link
Contributor

@octonato octonato left a 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 = {
Copy link
Contributor

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): Configuration

I 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. :-)

@erip
Copy link
Contributor Author

erip commented Jan 5, 2018

@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?

@octonato
Copy link
Contributor

octonato commented Jan 5, 2018

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.

@erip
Copy link
Contributor Author

erip commented Jan 6, 2018

You can cherrypick the latest commit if you want this PR... only thing that changes is indentation between all commits.

@gmethvin gmethvin merged commit 9cd76d4 into playframework:master Jan 6, 2018
gmethvin pushed a commit that referenced this pull request Jan 6, 2018
* 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
@gmethvin
Copy link
Member

gmethvin commented Jan 6, 2018

I backported this to 2.6.x: ff2df6b

@erip erip deleted the patch-3 branch January 6, 2018 22:54
@erip
Copy link
Contributor Author

erip commented Jan 6, 2018

Thanks so much, @gmethvin. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants