eclipse-yaml-editor
eclipse-yaml-editor copied to clipboard
formatter
Please improve formatter for better _____ with default settings yamllint
current errors:
- missing document start "---"
- no new line character at the end of file
- wrong indentation in sequence
- inline comment: "too few spaces before comment"
Sorry, but I do not exactly understand what is meant by the description.
What I (hopefully) understand:
- Your are using yamllint
- You would like to have a yaml document formatted by Yaml-Editor per default in a way so it is automatically "green" when calling yamllint default settings
What I not understand:
- What is meant with ___________ ?
- current errors
Please add some example yaml snippets and describe your wanted behaviour: I would like to have
- origin one (unformatted)
- formatted with Yaml-Editor
- WANTED format output to be suitable for yamllint
I'm sorry for my mistakes
file suitable for yamllint (no errors or warnings) WANTED format:
---
some_key:
- sequence_1
- sequence_2 # inline comment, "#" indented by two spaces
# - sequence_commented
another_key:
after auto-format previous file (Shift-CRTL-F in Eclipse):
some_key:
- sequence_1
- sequence_2 # inline comment
another_key: null
# ----------------
# Orphan comments:
# ----------------
# Was at begin of line:5 :# - sequence_commented
result of yamllint after auto-formatting
test.yml
1:1 warning missing document start "---" (document-start)
2:1 error wrong indentation: expected 2 but found 0 (indentation)
3:14 warning too few spaces before comment (comments)
5:1 warning comment not indented like content (comments-indentation)
8:49 error no new line character at the end of file (new-line-at-end-of-file)
about errors: 1:1 - example in documentation 2:1 - in example in documentation sequence indented as expect yamllint 3:14 - example in documentation 8:49 - file must ending with new-line-at-end-of-file for better compatibility with Linux & git
thank you
Is there an external formatter tool which could do the job? Inside bash editor we got an external formatter option, see https://github.com/de-jcup/eclipse-bash-editor/issues/117 which can call any external formatter - per default beautysh.
Would this be an option?