Skip to content

Commit

Permalink
feat: add xmllint formatter (#259)
Browse files Browse the repository at this point in the history
* feat: add xmllint formatter

* doc: shorten xmllint description

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
  • Loading branch information
chefe and stevearc authored Jan 2, 2024
1 parent ad2b5ec commit c50ba4b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ You can view this list in vim with `:help conform-formatters`
- [uncrustify](https://github.com/uncrustify/uncrustify) - A source code beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and Vala.
- [usort](https://github.com/facebook/usort) - Safe, minimal import sorting for Python projects.
- [xmlformat](https://github.com/pamoller/xmlformatter) - xmlformatter is an Open Source Python package, which provides formatting of XML documents.
- [xmllint](http://xmlsoft.org/xmllint.html) - Despite the name, xmllint can be used to format XML files as well as lint them, and that's the mode this formatter is using.
- [yamlfix](https://github.com/lyz-code/yamlfix) - A configurable YAML formatter that keeps comments.
- [yamlfmt](https://github.com/google/yamlfmt) - yamlfmt is an extensible command line tool or library to format yaml files.
- [yapf](https://github.com/google/yapf) - Yet Another Python Formatter.
Expand Down
2 changes: 2 additions & 0 deletions doc/conform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ FORMATTERS *conform-formatter
`usort` - Safe, minimal import sorting for Python projects.
`xmlformat` - xmlformatter is an Open Source Python package, which provides
formatting of XML documents.
`xmllint` - Despite the name, xmllint can be used to format XML files as well as
lint them, and that's the mode this formatter is using.
`yamlfix` - A configurable YAML formatter that keeps comments.
`yamlfmt` - yamlfmt is an extensible command line tool or library to format yaml
files.
Expand Down
9 changes: 9 additions & 0 deletions lua/conform/formatters/xmllint.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---@type conform.FileFormatterConfig
return {
meta = {
url = "http://xmlsoft.org/xmllint.html",
description = "Despite the name, xmllint can be used to format XML files as well as lint them.",
},
command = "xmllint",
args = { "--format", "-" },
}

0 comments on commit c50ba4b

Please sign in to comment.