Skip to content
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

Indentation size and blank lines #127

Closed
LichtHund opened this issue Apr 3, 2020 · 3 comments
Closed

Indentation size and blank lines #127

LichtHund opened this issue Apr 3, 2020 · 3 comments
Milestone

Comments

@LichtHund
Copy link
Contributor

Hello! I wanted to ask if it's currently possible to change the indentation size (currently it's 4 spaces, I would like to make it 2) and to add a blank line to separate sections.
I managed to make this changes on my fork, but wanted to confirm if it was already possible or not because the way I did it seemed hacky.

@ljacqu
Copy link
Member

ljacqu commented Apr 5, 2020

Hi! It's not possible to change the indention so far. I like the changes you've done on your fork—I would just move the indention parameter as a property inside YamlFileResourceOptions though.

Blank lines can be configured with the YamlFileResourceOptions#numberOfLinesBeforeFunction but that's between properties and doesn't allow empty lines between comments. I hadn't realized this would be desired :) I don't have a good idea there besides adding another Function to the YamlFileResourceOptions, unless PathElement (the argument the existing function already takes) is changed to represent either a YAML element or a comment.

If you agree I'd propose that you create a pull request for the indention issue, and for the second matter I'll come up with a solution and ask you for feedback.

@LichtHund
Copy link
Contributor Author

There you go I made the pull request with the suggestions you said.
Also I found that currently if you add a simple \n to the @Comment annotation it does exactly what I want for the empty lines.
However it needs to be the first thing, doing something like @Comment({"Test", "\n"}) will result in a blank line with # in it.
So I am fine with how that is right now.
#129

ljacqu pushed a commit that referenced this issue Apr 12, 2020
* Added indentation size to resource options
* Using string builder for indent method instead
* Temporary fix to get a new line before comments
@ljacqu ljacqu added this to the 1.2.0 Release milestone Apr 12, 2020
@ljacqu
Copy link
Member

ljacqu commented Apr 13, 2020

@Ipsk Once again thanks for the PR! For the comment thing I have to say I like your solution and since you said it was all you need I'll not investigate it further, unless you'd want to configure it on a more general level.

@ljacqu ljacqu closed this as completed Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants