mirror of
https://github.com/vale981/apheleia
synced 2025-03-04 09:01:42 -05:00
Add support for yq
(#250)
<!-- To expedite the pull request process, please see the contributor guide for my projects: <https://github.com/raxod502/contributor-guide> -->
This commit is contained in:
parent
615b0f5591
commit
2b354f405b
20 changed files with 60 additions and 1 deletions
|
@ -64,6 +64,7 @@ The format is based on [Keep a Changelog].
|
|||
|
||||
### Formatters
|
||||
|
||||
* [`yq`](https://mikefarah.gitbook.io/yq/) for YAML, JSON, CSV, TSV, XML and [.properties](https://en.wikipedia.org/wiki/.properties) ([#250]).
|
||||
* [purs-tidy](https://github.com/natefaubion/purescript-tidy) for PureScript ([#182]).
|
||||
* [`jq`](https://stedolan.github.io/jq/) for
|
||||
[JSON](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON)
|
||||
|
|
|
@ -149,7 +149,19 @@
|
|||
(stylua . ("stylua" "-"))
|
||||
(rustfmt . ("rustfmt" "--quiet" "--emit" "stdout"))
|
||||
(terraform . ("terraform" "fmt" "-"))
|
||||
(yapf . ("yapf")))
|
||||
(yapf . ("yapf"))
|
||||
(yq-csv . ("yq" "--prettyPrint" "--no-colors"
|
||||
"--input-format" "csv" "--output-format" "csv"))
|
||||
(yq-json . ("yq" "--prettyPrint" "--no-colors"
|
||||
"--input-format" "json" "--output-format" "json"))
|
||||
(yq-properties . ("yq" "--prettyPrint" "--no-colors"
|
||||
"--input-format" "props" "--output-format" "props"))
|
||||
(yq-tsv . ("yq" "--prettyPrint" "--no-colors"
|
||||
"--input-format" "tsv" "--output-format" "tsv"))
|
||||
(yq-xml . ("yq" "--prettyPrint" "--no-colors"
|
||||
"--input-format" "xml" "--output-format" "xml"))
|
||||
(yq-yaml . ("yq" "--prettyPrint" "--no-colors" "--no-doc"
|
||||
"--input-format" "yaml" "--output-format" "yaml")))
|
||||
"Alist of code formatting commands.
|
||||
The keys may be any symbols you want, and the values are shell
|
||||
commands, lists of strings and symbols, or a function symbol.
|
||||
|
|
1
test/formatters/installers/yq-csv.bash
Symbolic link
1
test/formatters/installers/yq-csv.bash
Symbolic link
|
@ -0,0 +1 @@
|
|||
yq-yaml.bash
|
1
test/formatters/installers/yq-json.bash
Symbolic link
1
test/formatters/installers/yq-json.bash
Symbolic link
|
@ -0,0 +1 @@
|
|||
yq-yaml.bash
|
1
test/formatters/installers/yq-properties.bash
Symbolic link
1
test/formatters/installers/yq-properties.bash
Symbolic link
|
@ -0,0 +1 @@
|
|||
yq-yaml.bash
|
1
test/formatters/installers/yq-tsv.bash
Symbolic link
1
test/formatters/installers/yq-tsv.bash
Symbolic link
|
@ -0,0 +1 @@
|
|||
yq-yaml.bash
|
1
test/formatters/installers/yq-xml.bash
Symbolic link
1
test/formatters/installers/yq-xml.bash
Symbolic link
|
@ -0,0 +1 @@
|
|||
yq-yaml.bash
|
1
test/formatters/installers/yq-yaml.bash
Normal file
1
test/formatters/installers/yq-yaml.bash
Normal file
|
@ -0,0 +1 @@
|
|||
curl -fsSLo /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 && chmod +x /usr/local/bin/yq
|
2
test/formatters/samplecode/yq-csv/in.csv
Normal file
2
test/formatters/samplecode/yq-csv/in.csv
Normal file
|
@ -0,0 +1,2 @@
|
|||
hello,"world"
|
||||
a,"1,2"
|
|
2
test/formatters/samplecode/yq-csv/out.csv
Normal file
2
test/formatters/samplecode/yq-csv/out.csv
Normal file
|
@ -0,0 +1,2 @@
|
|||
hello,world
|
||||
a,"1,2"
|
|
1
test/formatters/samplecode/yq-json/in.json
Symbolic link
1
test/formatters/samplecode/yq-json/in.json
Symbolic link
|
@ -0,0 +1 @@
|
|||
../prettier-json/in.json
|
19
test/formatters/samplecode/yq-json/out.json
Normal file
19
test/formatters/samplecode/yq-json/out.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"arrowParens": "always",
|
||||
"bracketSpacing": true,
|
||||
"embeddedLanguageFormatting": "auto",
|
||||
"htmlWhitespaceSensitivity": "css",
|
||||
"insertPragma": false,
|
||||
"jsxBracketSameLine": false,
|
||||
"jsxSingleQuote": false,
|
||||
"printWidth": 80,
|
||||
"proseWrap": "preserve",
|
||||
"quoteProps": "as-needed",
|
||||
"requirePragma": false,
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "es5",
|
||||
"useTabs": false,
|
||||
"vueIndentScriptAndStyle": false
|
||||
}
|
1
test/formatters/samplecode/yq-properties/in.properties
Normal file
1
test/formatters/samplecode/yq-properties/in.properties
Normal file
|
@ -0,0 +1 @@
|
|||
foo=bar
|
1
test/formatters/samplecode/yq-properties/out.properties
Normal file
1
test/formatters/samplecode/yq-properties/out.properties
Normal file
|
@ -0,0 +1 @@
|
|||
foo = bar
|
2
test/formatters/samplecode/yq-tsv/in.tsv
Normal file
2
test/formatters/samplecode/yq-tsv/in.tsv
Normal file
|
@ -0,0 +1,2 @@
|
|||
hello "world"
|
||||
a "1 2"
|
|
2
test/formatters/samplecode/yq-tsv/out.tsv
Normal file
2
test/formatters/samplecode/yq-tsv/out.tsv
Normal file
|
@ -0,0 +1,2 @@
|
|||
hello world
|
||||
a "1 2"
|
|
1
test/formatters/samplecode/yq-xml/in.xml
Normal file
1
test/formatters/samplecode/yq-xml/in.xml
Normal file
|
@ -0,0 +1 @@
|
|||
<hello who='world' />
|
1
test/formatters/samplecode/yq-xml/out.xml
Normal file
1
test/formatters/samplecode/yq-xml/out.xml
Normal file
|
@ -0,0 +1 @@
|
|||
<hello who="world"></hello>
|
1
test/formatters/samplecode/yq-yaml/in.yml
Symbolic link
1
test/formatters/samplecode/yq-yaml/in.yml
Symbolic link
|
@ -0,0 +1 @@
|
|||
../prettier-yaml/in.yml
|
7
test/formatters/samplecode/yq-yaml/out.yml
Normal file
7
test/formatters/samplecode/yq-yaml/out.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
- hosts: all
|
||||
tasks:
|
||||
- name: Get software for apt repository management.
|
||||
apt:
|
||||
state: present
|
||||
name:
|
||||
- python3-pycurl
|
Loading…
Add table
Reference in a new issue