Skip to content

Commit

Permalink
feat: add better-yaml.documentOptions.version global option
Browse files Browse the repository at this point in the history
You can set YAML version used by documents without a %YAML directive.

fix #25
  • Loading branch information
longkai committed Nov 19, 2024
1 parent e91dc65 commit 088dc91
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 102 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to the "kubernetes-yaml-formatter" extension will be documen

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## 2.3.0 (19 Nov 2024)

- add `better-yaml.documentOptions.version` global option to set YAML version used by documents without a %YAML directive.
- upgrade dependencies.

## 2.0.0 (03 Nov 2024)

Rename to **Better YAML Formatter** since it works well with what you think about YAML :)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This extension is made for you :)

Format **correct**, **consistent** and **customized** yaml text with **Better YAML Formatter**.

Watch the demo video:
### 🔥 Watch the demo video 👇

https://github.com/user-attachments/assets/dfdec44b-221f-436d-9d90-413f0c0effe6

Expand Down Expand Up @@ -58,6 +58,7 @@ This extension contributes the following settings:
* `better-yaml.directives`: Include directives in the output. If true, at least the document-start marker --- is always included. If false, no directives or marker is ever included. If null, directives and marker may be included if required.
* `better-yaml.commentString`: Change the comment prefix string. By default, empty comment lines are left empty, lines consisting of a single space are replaced by `#`, and all other lines are prefixed with a `#`.
* `better-yaml.lineWidth`: Maximum line width (set to 0 to disable folding). This is a soft limit, as only double-quoted semantics allow for inserting a line break in the middle of a word.
* `better-yaml.documentOptions.version`: The YAML version used by documents without a %YAML directive. Must be '1.1' or '1.2'. Default to '1.2'.

## Thanks

Expand Down
192 changes: 96 additions & 96 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
],
"default": 0,
"description": "Maximum line width (set to 0 to disable folding). This is a soft limit, as only double-quoted semantics allow for inserting a line break in the middle of a word."
},
"better-yaml.documentOptions.version": {
"type": [
"string"
],
"default": "1.2",
"description": "The YAML version used by documents without a %YAML directive. Must be '1.1' or '1.2'."
}
}
},
Expand Down Expand Up @@ -124,6 +131,6 @@
"process": "^0.11.10"
},
"dependencies": {
"yaml": "^2.6.0"
"yaml": "^2.6.1"
}
}
Loading

0 comments on commit 088dc91

Please sign in to comment.