Skip to content
This repository was archived by the owner on Jun 18, 2019. It is now read-only.

Adds support for lenient mode allowing lookups using camelCased identifiers for config entries specified in dashed, underscored, all lower cased or all upper cased format.#8

Open
odd wants to merge 1 commit into
ElderResearch:developfrom
odd:leniency

Conversation

@odd
Copy link
Copy Markdown

@odd odd commented Nov 2, 2016

No description provided.

…ifiers for config entries specified in dashed, underscored, all lower cased or all upper cased format.
@metasim
Copy link
Copy Markdown
Contributor

metasim commented Nov 3, 2016

@odd I appreciate the PR, but I'm not so sure I'm in agreement that it's a good idea to to allow for non-precise attribute lookup. What's your argument for having it? Don't like using backticks (e.g. my-prop?

@odd
Copy link
Copy Markdown
Author

odd commented Nov 3, 2016

@metasim Hello and thanks for the feedback.

Since the recommended naming policies differ between Scala and HOCON (camel case for the former and dashes for the latter) you unfortunately have to break one of them. By having the library translate between them (or rather translate from camel case to dashes) you can get the best of both worlds (your HOCON looks like HOCON and your Scala looks like Scala). But this is of course just a matter of style and not very important, I fully understand if you don't think it worth the added complexity.

The pull request also includes translation of cameCase to underscored, all lower cased and all upper cased formats but this can be removed if you want to minimize it.

Greetings
Odd

@metasim
Copy link
Copy Markdown
Contributor

metasim commented Nov 5, 2016

Let me think more on it. Because you can do conf.name-with-dash.as[String] (and obviously conf.name_with_underscore.as[String]) in Scala, I don't see the pressing need for the additional complexity.

@odd
Copy link
Copy Markdown
Author

odd commented Nov 5, 2016

Let me just add that one thing that speaks to adding (at least) the
automatic camelCased-to-dashed-transformation is that it enhances the
primary functionality (USP if you will) that sets the SSC project apart
from all the other Scala-wrapper-for-Typesafe-Config alternatives: that the
config lookup code looks like regular idiomatic Scala. Allowing
camelCase-identifiers on the Scala-side will only help emphasize that
feature while still letting the HOCON side of things look like regular
HOCON.

On Sat, Nov 5, 2016 at 7:32 PM, Simeon H.K. Fitch notifications@github.com
wrote:

Let me think more on it. Because you can do conf.name-with-dash.as[
String](and obviously conf.name_with_underscore.as[String]) in Scala, I
don't see the pressing need for the additional complexity.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#8 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AADAlYEWVkGxJoAudsCBSD1MJPXmKGNTks5q7MurgaJpZM4KnZwq
.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants