mirror of
https://github.com/vale981/apheleia
synced 2025-03-04 17:11:40 -05:00
Run jq without colorization (#213)
Set the -M flag to jq: ```text λ jq --help mohkale@mk-desktop ~ jq - commandline JSON processor [version 1.7] Usage: jq [options] <jq filter> [file...] jq [options] --args <jq filter> [strings...] jq [options] --jsonargs <jq filter> [JSON_TEXTS...] jq is a tool for processing JSON inputs, applying the given filter to its JSON text inputs and producing the filter's results as JSON on standard output. The simplest filter is ., which copies jq's input to its output unmodified except for formatting. For more advanced filters see the jq(1) manpage ("man jq") and/or https://jqlang.github.io/jq/. Example: $ echo '{"foo": 0}' | jq . { "foo": 0 } Command options: -n, --null-input use `null` as the single input value; -R, --raw-input read each line as string instead of JSON; -s, --slurp read all inputs into an array and use it as the single input value; -c, --compact-output compact instead of pretty-printed output; -r, --raw-output output strings without escapes and quotes; --raw-output0 implies -r and output NUL after each output; -j, --join-output implies -r and output without newline after each output; -a, --ascii-output output strings by only ASCII characters using escape sequences; -S, --sort-keys sort keys of each object on output; -C, --color-output colorize JSON output; -M, --monochrome-output disable colored output; --tab use tabs for indentation; --indent n use n spaces for indentation (max 7 spaces); --unbuffered flush output stream after each output; --stream parse the input value in streaming fashion; --stream-errors implies --stream and report parse error as an array; --seq parse input/output as application/json-seq; -f, --from-file file load filter from the file; -L directory search modules from the directory; --arg name value set $name to the string value; --argjson name value set $name to the JSON value; --slurpfile name file set $name to an array of JSON values read from the file; --rawfile name file set $name to string contents of file; --args consume remaining arguments as positional string values; --jsonargs consume remaining arguments as positional JSON values; -e, --exit-status set exit status code based on the output; -V, --version show the version; --build-configuration show jq's build configuration; -h, --help show the help; -- terminates argument processing; Named arguments are also available as $ARGS.named[], while positional arguments are available as $ARGS.positional[]. ```
This commit is contained in:
parent
c7e41940ca
commit
bac7277ed0
2 changed files with 3 additions and 1 deletions
|
@ -24,6 +24,7 @@ The format is based on [Keep a Changelog].
|
|||
* `ktlint` would emit log messages into its stdout when formatting,
|
||||
and these would get spliced into the source file. This has been fixed
|
||||
by suppressing all logs from `ktlint`.
|
||||
* Disable colorized output with the jq formatter ([#213]).
|
||||
|
||||
### Formatters
|
||||
|
||||
|
@ -64,6 +65,7 @@ The format is based on [Keep a Changelog].
|
|||
[#182]: https://github.com/radian-software/apheleia/pull/182
|
||||
[#187]: https://github.com/radian-software/apheleia/pull/187
|
||||
[#196]: https://github.com/radian-software/apheleia/pull/196
|
||||
[#213]: https://github.com/radian-software/apheleia/pull/213
|
||||
[#214]: https://github.com/radian-software/apheleia/pull/214
|
||||
|
||||
## 3.2 (released 2023-02-25)
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
'web-mode-indent-style)))
|
||||
(apheleia-formatters-fill-column "-wrap"))
|
||||
(isort . ("isort" "-"))
|
||||
(jq "jq" "."
|
||||
(jq "jq" "." "-M"
|
||||
(apheleia-formatters-js-indent "--tab" "--indent"))
|
||||
(lisp-indent . apheleia-indent-lisp-buffer)
|
||||
(ktlint . ("ktlint" "--log-level=none" "--stdin" "-F" "-"))
|
||||
|
|
Loading…
Add table
Reference in a new issue