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

Ability to change spacing before a comment #11

Closed
maxdanilov opened this issue Feb 2, 2020 · 4 comments · Fixed by #28
Closed

Ability to change spacing before a comment #11

maxdanilov opened this issue Feb 2, 2020 · 4 comments · Fixed by #28

Comments

@maxdanilov
Copy link

maxdanilov commented Feb 2, 2020

Hi there,
Really enjoying your tool, works very well!

One request though would be to be able to set spacing before comments in the output.
Currently, the comments always seem to stay on their previous position, even if actual yaml code has been moved by formatting (because of ruamel I guess?)

Example:
Input file:

---
items:
    - part_no:   A4786 # comment

Output from yamkix:

---
items:
- part_no: A4786       # comment

Feature request:
I think it should be a tunable parameter, as e.g. yamllint has a default rule of 2 spaces before a comment.

Example:

yamkix --spaces-before-comment 2
---
items:
- part_no: A4786  # comment
@maxdanilov maxdanilov changed the title Ability to change the spacing before a comment Ability to change spacing before a comment Feb 2, 2020
@looztra
Copy link
Owner

looztra commented Feb 2, 2020 via email

@looztra
Copy link
Owner

looztra commented Mar 28, 2020

There doesn't seem to have a trivial fix, I'll have to contact the author of ruamel.yaml to see if something can be done

@looztra
Copy link
Owner

looztra commented Mar 29, 2020

I am working on this issue but I cannot get to the expected result for the moment :

@looztra
Copy link
Owner

looztra commented Apr 1, 2020

Available in v0.6.0

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 a pull request may close this issue.

2 participants