diff options
| author | Ville Skyttä <ville.skytta@iki.fi> | 2023-11-23 22:34:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-23 12:34:41 -0800 |
| commit | 732efe4261f0bb2c095dabbcaac4a5f73fe8ec3c (patch) | |
| tree | e2d4eeea152f9ff6911e4420d2a29e16d977b487 | |
| parent | 317fe75906e85bfcf9ca481b4804a79c25ab3b9c (diff) | |
Add support for `xmllint` (#251)
<!--
To expedite the pull request process, please see the contributor guide
for my projects:
<https://github.com/raxod502/contributor-guide>
-->
Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
| -rw-r--r-- | CHANGELOG.md | 17 | ||||
| -rw-r--r-- | apheleia-formatters.el | 1 | ||||
| -rw-r--r-- | test/formatters/installers/xmllint.bash | 1 | ||||
| -rw-r--r-- | test/formatters/samplecode/xmllint/in.xml | 1 | ||||
| -rw-r--r-- | test/formatters/samplecode/xmllint/out.xml | 2 |
5 files changed, 14 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b7a7788..ad15520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,13 +63,6 @@ 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) - ([#174]). -* [`gawk`](https://www.gnu.org/software/gawk/) for - [awk](https://en.wikipedia.org/wiki/AWK) ([#187]). * [`asmfmt`](https://github.com/klauspost/asmfmt) for assembly ([#168]). * [`astyle`](https://github.com/steinwurf/astyle) for C ([#169]). * [`beautysh`](https://github.com/lovesegfault/beautysh) for shell @@ -79,10 +72,17 @@ The format is based on [Keep a Changelog]. * [`cmake-format`](https://github.com/cheshirekow/cmake_format) for [CMake](https://cmake.org/) ([#172]). * [`fourmolu`](https://github.com/fourmolu/fourmolu) for haskell +* [`gawk`](https://www.gnu.org/software/gawk/) for + [awk](https://en.wikipedia.org/wiki/AWK) ([#187]). +* [`hclfmt`](https://github.com/hashicorp/hcl/tree/main/cmd/hclfmt) for [HCL](https://github.com/hashicorp/hcl) ([#231]) * [`html-tidy`](https://www.html-tidy.org/) for HTML/XML ([#173]). +* [`jq`](https://stedolan.github.io/jq/) for + [JSON](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON) + ([#174]). * [`ormolu`](https://github.com/tweag/ormolu) for haskell. * [`perltidy`](https://perltidy.sourceforge.net/) for [perl](https://www.perl.org/) ([#175]). +* [purs-tidy](https://github.com/natefaubion/purescript-tidy) for PureScript ([#182]). * [`rubocop`](https://github.com/rubocop/rubocop) for [ruby](https://www.ruby-lang.org/en/) ([#176]). * [`ruby-standard`](https://github.com/standardrb/standard) for [ruby](https://www.ruby-lang.org/en/) ([#201]) @@ -90,8 +90,9 @@ The format is based on [Keep a Changelog]. [python](https://python.org) ([#236]) * [`rufo`](https://github.com/ruby-formatter/rufo) for [Ruby](https://www.ruby-lang.org/en/) ([#177]). +* [`xmllint`](https://gitlab.gnome.org/GNOME/libxml2) for XML ([#251]). * [`yapf`](https://github.com/google/yapf) for [Python](https://www.python.org/) ([#196]) -* [`hclfmt`](https://github.com/hashicorp/hcl/tree/main/cmd/hclfmt) for [HCL](https://github.com/hashicorp/hcl) ([#231]) +* [`yq`](https://mikefarah.gitbook.io/yq/) for YAML, JSON, CSV, TSV, XML and [.properties](https://en.wikipedia.org/wiki/.properties) ([#250]). [#167]: https://github.com/radian-software/apheleia/pull/167 [#168]: https://github.com/radian-software/apheleia/pull/168 diff --git a/apheleia-formatters.el b/apheleia-formatters.el index 2660297..d75eb15 100644 --- a/apheleia-formatters.el +++ b/apheleia-formatters.el @@ -149,6 +149,7 @@ (stylua . ("stylua" "-")) (rustfmt . ("rustfmt" "--quiet" "--emit" "stdout")) (terraform . ("terraform" "fmt" "-")) + (xmllint . ("xmllint" "--format" "-")) (yapf . ("yapf")) (yq-csv . ("yq" "--prettyPrint" "--no-colors" "--input-format" "csv" "--output-format" "csv")) diff --git a/test/formatters/installers/xmllint.bash b/test/formatters/installers/xmllint.bash new file mode 100644 index 0000000..4544446 --- /dev/null +++ b/test/formatters/installers/xmllint.bash @@ -0,0 +1 @@ +apt-get install -y libxml2-utils diff --git a/test/formatters/samplecode/xmllint/in.xml b/test/formatters/samplecode/xmllint/in.xml new file mode 100644 index 0000000..81ad3c9 --- /dev/null +++ b/test/formatters/samplecode/xmllint/in.xml @@ -0,0 +1 @@ +<hello who='world' /> diff --git a/test/formatters/samplecode/xmllint/out.xml b/test/formatters/samplecode/xmllint/out.xml new file mode 100644 index 0000000..0d9b1aa --- /dev/null +++ b/test/formatters/samplecode/xmllint/out.xml @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<hello who="world"/> |
