mirror of
https://github.com/vale981/apheleia
synced 2025-03-04 09:01:42 -05:00
Add support for JSON with python3 -m json.tool
(#257)
https://docs.python.org/3/library/json.html#module-json.tool
This commit is contained in:
parent
a38279566a
commit
41dff902fb
6 changed files with 28 additions and 0 deletions
|
@ -16,6 +16,8 @@ The format is based on [Keep a Changelog].
|
|||
[HTML](https://en.wikipedia.org/wiki/HTML) and
|
||||
[CSS](https://www.google.com/search?q=css)
|
||||
([#229])
|
||||
* [`python3-json`](https://docs.python.org/3/library/json.html#module-json.tool)
|
||||
for JSON ([#257]).
|
||||
* [`robotidy`](https://robotidy.readthedocs.io) for Robot Framework files
|
||||
([#263]).
|
||||
* [denofmt](https://docs.deno.com/runtime/manual/tools/formatter) for
|
||||
|
@ -24,6 +26,7 @@ The format is based on [Keep a Changelog].
|
|||
clojurescript, edn files. ([#271])
|
||||
|
||||
[#229]: https://github.com/radian-software/apheleia/pull/229
|
||||
[#257]: https://github.com/radian-software/apheleia/pull/257
|
||||
[#260]: https://github.com/radian-software/apheleia/pull/260
|
||||
[#261]: https://github.com/radian-software/apheleia/pull/261
|
||||
[#263]: https://github.com/radian-software/apheleia/pull/263
|
||||
|
|
|
@ -150,6 +150,9 @@
|
|||
(robotidy . ("robotidy" "--no-color" "-"
|
||||
(apheleia-formatters-indent nil "--indent")
|
||||
(apheleia-formatters-fill-column "--line-length")))
|
||||
(python3-json
|
||||
. ("python3" "-m" "json.tool"
|
||||
(apheleia-formatters-indent "--tab" "--indent")))
|
||||
(rubocop . ("rubocop" "--stdin" filepath "--auto-correct"
|
||||
"--stderr" "--format" "quiet" "--fail-level" "fatal"))
|
||||
(ruby-standard . ("standardrb" "--stdin" filepath "--fix" "--stderr"
|
||||
|
|
|
@ -49,6 +49,7 @@ always returns nil to defer to the formatter."
|
|||
(nxml-mode 'nxml-child-indent)
|
||||
(robot-mode 'robot-mode-basic-offset)
|
||||
(perl-mode 'perl-indent-level)
|
||||
(python-mode 'python-indent-offset)
|
||||
(scss-mode 'css-indent-offset)
|
||||
(web-mode 'web-mode-indent-style)
|
||||
(tsx-ts-mode 'typescript-ts-mode-indent-offset)
|
||||
|
|
1
test/formatters/installers/python3-json.bash
Normal file
1
test/formatters/installers/python3-json.bash
Normal file
|
@ -0,0 +1 @@
|
|||
apt-get install -y python3
|
1
test/formatters/samplecode/python3-json/in.json
Symbolic link
1
test/formatters/samplecode/python3-json/in.json
Symbolic link
|
@ -0,0 +1 @@
|
|||
../prettier-json/in.json
|
19
test/formatters/samplecode/python3-json/out.json
Normal file
19
test/formatters/samplecode/python3-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
|
||||
}
|
Loading…
Add table
Reference in a new issue