aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--apheleia-formatters.el2
-rw-r--r--test/formatters/samplecode/yq-yaml/out.yml1
-rw-r--r--test/formatters/samplecode/yq-yaml/test-dont-add-docsep/in.yml12
-rw-r--r--test/formatters/samplecode/yq-yaml/test-dont-add-docsep/out.yml12
5 files changed, 28 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3cda2e9..51b6b9e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog].
## Unreleased
### Formatters
+* Removed `--no-doc` argument from yq-yaml to avoid breaking
+ multi-document yaml files ([#386]).
* Use clang-format for formatting Objective-C/C++ files ([#378]).
* `bibtex-reformat` for BibTeX files.
* `rubocop` changed to use `--force-exclusion` to obey exclusions in config
diff --git a/apheleia-formatters.el b/apheleia-formatters.el
index 53e7387..c98b790 100644
--- a/apheleia-formatters.el
+++ b/apheleia-formatters.el
@@ -238,7 +238,7 @@
(yq-xml . ("yq" "--prettyPrint" "--no-colors"
"--input-format" "xml" "--output-format" "xml"
(apheleia-formatters-indent nil "--indent")))
- (yq-yaml . ("yq" "--prettyPrint" "--no-colors" "--no-doc"
+ (yq-yaml . ("yq" "--prettyPrint" "--no-colors"
"--input-format" "yaml" "--output-format" "yaml"
(apheleia-formatters-indent nil "--indent")))
(zig-fmt . ("zig" "fmt" "--stdin")))
diff --git a/test/formatters/samplecode/yq-yaml/out.yml b/test/formatters/samplecode/yq-yaml/out.yml
index 8b4f56d..e85025b 100644
--- a/test/formatters/samplecode/yq-yaml/out.yml
+++ b/test/formatters/samplecode/yq-yaml/out.yml
@@ -1,3 +1,4 @@
+---
- hosts: all
tasks:
- name: Get software for apt repository management.
diff --git a/test/formatters/samplecode/yq-yaml/test-dont-add-docsep/in.yml b/test/formatters/samplecode/yq-yaml/test-dont-add-docsep/in.yml
new file mode 100644
index 0000000..fe6f000
--- /dev/null
+++ b/test/formatters/samplecode/yq-yaml/test-dont-add-docsep/in.yml
@@ -0,0 +1,12 @@
+doc: v1
+meta:
+ title: t1
+ sub:
+ - sub1: 42
+ sub2: 3333
+doc: v1
+meta:
+ title: t2
+ sub:
+ - sub1: 43
+ sub2: 4444
diff --git a/test/formatters/samplecode/yq-yaml/test-dont-add-docsep/out.yml b/test/formatters/samplecode/yq-yaml/test-dont-add-docsep/out.yml
new file mode 100644
index 0000000..b61f9b4
--- /dev/null
+++ b/test/formatters/samplecode/yq-yaml/test-dont-add-docsep/out.yml
@@ -0,0 +1,12 @@
+doc: v1
+meta:
+ title: t1
+ sub:
+ - sub1: 42
+ sub2: 3333
+doc: v1
+meta:
+ title: t2
+ sub:
+ - sub1: 43
+ sub2: 4444