yaml: use yamlfmt retain_line_breaks instead of custom awk chain
This commit is contained in:
@@ -17,8 +17,8 @@ return {
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
yml = { "yamlfmt", "blank_yaml_blocks" },
|
||||
yaml = { "yamlfmt", "blank_yaml_blocks" },
|
||||
yml = { "yamlfmt" },
|
||||
yaml = { "yamlfmt" },
|
||||
nix = { "nixfmt" },
|
||||
bash = { "shfmt" },
|
||||
php = { "mago_format" },
|
||||
@@ -31,10 +31,8 @@ return {
|
||||
shfmt = {
|
||||
append_args = { "-i", "2" },
|
||||
},
|
||||
blank_yaml_blocks = {
|
||||
command = "awk",
|
||||
args = { "{ if (NR>1 && $0 ~ /^[A-Za-z_][A-Za-z0-9_.-]*:/ && prev != \"\") print \"\"; print; prev = $0 }" },
|
||||
stdin = true,
|
||||
yamlfmt = {
|
||||
args = { "-formatter", "retain_line_breaks=true", "-" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user