diff --git a/CHANGELOG.md b/CHANGELOG.md index b7a77884..ad15520b 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 26602978..d75eb15c 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 00000000..45444467 --- /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 00000000..81ad3c94 --- /dev/null +++ b/test/formatters/samplecode/xmllint/in.xml @@ -0,0 +1 @@ + diff --git a/test/formatters/samplecode/xmllint/out.xml b/test/formatters/samplecode/xmllint/out.xml new file mode 100644 index 00000000..0d9b1aa2 --- /dev/null +++ b/test/formatters/samplecode/xmllint/out.xml @@ -0,0 +1,2 @@ + +