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:
Ville Skyttä 2023-12-15 04:04:19 +02:00 committed by GitHub
parent a38279566a
commit 41dff902fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 0 deletions

View file

@ -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

View file

@ -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"

View file

@ -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)

View file

@ -0,0 +1 @@
apt-get install -y python3

View file

@ -0,0 +1 @@
../prettier-json/in.json

View 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
}