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

formatter #86

Open
daltinn opened this issue Jan 29, 2020 · 3 comments
Open

formatter #86

daltinn opened this issue Jan 29, 2020 · 3 comments

Comments

@daltinn
Copy link

daltinn commented Jan 29, 2020

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"
@de-jcup
Copy link
Owner

de-jcup commented Jan 30, 2020

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

@daltinn
Copy link
Author

daltinn commented Jan 30, 2020

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

@de-jcup
Copy link
Owner

de-jcup commented Feb 18, 2020

Is there an external formatter tool which could do the job? Inside bash editor we got an external formatter option, see de-jcup/eclipse-bash-editor#117 which can call any external formatter - per default beautysh.

Would this be an option?

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

No branches or pull requests

2 participants