config icon indicating copy to clipboard operation
config copied to clipboard

render option to configure indentation characters

Open aalleexxeeii opened this issue 8 years ago • 5 comments

So far, 4 spaces have been hardcoded with no ways to change it

aalleexxeeii avatar Jul 02 '16 18:07 aalleexxeeii

Seems simple and useful. Do you have time to add a unit test that changes the indentation ? I'd look for the existing tests for render and add another one alongside that uses different indentation.

havocp avatar Jul 02 '16 19:07 havocp

I would try adding tests, but, as of now, I can't even run tests on master without my changes. Looks like some of them fail due to CRLF issues as my platform is Windows:

- Quoted("hello\nworld")
+ Quoted("hello\r\nworld")

Others have cross-version Scala issues:

expected:<List( Before)> but was:<Buffer( Before

Do I need to do anything additional to pass the standard tests first?

aalleexxeeii avatar Jul 04 '16 15:07 aalleexxeeii

If you can run tests and at least some of them pass, then you could add new tests, make those new ones pass on Windows, and then let the CI system tell us if the other ones still pass in the canonical environment.

havocp avatar Jul 05 '16 22:07 havocp

I also came across the ' Before' - make sure your files are checked out with LF.

Probably need to go through the code base and make sure that all the code is OS agnostic, possibly this amounts just to making sure that the system treats any of \n , \r , \r\n as a line ending.

Also, I'm seeing complexity/coupling issues in the tests because of uncertainty on the runtime environment eg is HOME defined or not, or is the path variable PATH or Path? Again this makes windows a problem as most of the code is written with Linux in mind. Alot of the tests would be easier to understand if they were invoked in a subprocess as this would give us complete control over the environment variables the test cases see.

Also runnign checkstyle etc would clean up some stuff.

Johnlon avatar Aug 11 '16 10:08 Johnlon

With https://github.com/typesafehub/config/pull/419 we have added PR validation on Windows. Therefore you should now have no problems when running tests on Windows. This is able to be merged after a test is added.

2m avatar Oct 06 '17 12:10 2m

We do not intend to extend the functionality of "Typesafe Config" further. See https://github.com/lightbend/config#maintained-by

ennru avatar Jul 06 '23 08:07 ennru