aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--doc/conform.txt4
-rw-r--r--lua/conform/formatters/markdownlint-cli2.lua11
3 files changed, 15 insertions, 2 deletions
diff --git a/README.md b/README.md
index 1d16903..f8fb03d 100644
--- a/README.md
+++ b/README.md
@@ -222,6 +222,7 @@ You can view this list in vim with `:help conform-formatters`
- [latexindent](https://github.com/cmhughes/latexindent.pl) - A perl script for formatting LaTeX files that is generally included in major TeX distributions.
- [markdown-toc](https://github.com/jonschlinkert/markdown-toc) - API and CLI for generating a markdown TOC (table of contents) for a README or any markdown files.
- [markdownlint](https://github.com/DavidAnson/markdownlint) - A Node.js style checker and lint tool for Markdown/CommonMark files.
+- [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) - A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the markdownlint library.
- [mdformat](https://github.com/executablebooks/mdformat) - An opinionated Markdown formatter.
- [mix](https://hexdocs.pm/mix/main/Mix.Tasks.Format.html) - Format Elixir files using the mix format command.
- [nixfmt](https://github.com/serokell/nixfmt) - nixfmt is a formatter for Nix code, intended to apply a uniform style.
@@ -496,7 +497,6 @@ Retrieve the available formatters for a buffer
`list_all_formatters(): conform.FormatterInfo[]` \
List information about all filetype-configured formatters
-
### get_formatter_info(formatter, bufnr)
`get_formatter_info(formatter, bufnr): conform.FormatterInfo` \
diff --git a/doc/conform.txt b/doc/conform.txt
index ae5db5e..cbc558d 100644
--- a/doc/conform.txt
+++ b/doc/conform.txt
@@ -228,7 +228,9 @@ FORMATTERS *conform-formatter
`markdown-toc` - API and CLI for generating a markdown TOC (table of contents)
for a README or any markdown files.
`markdownlint` - A Node.js style checker and lint tool for Markdown/CommonMark
- files.
+`markdownlint-cli2` - A fast, flexible, configuration-based command-line
+ interface for linting Markdown/CommonMark files with
+ the markdownlint library
`mdformat` - An opinionated Markdown formatter.
`mix` - Format Elixir files using the mix format command.
`nixfmt` - nixfmt is a formatter for Nix code, intended to apply a uniform
diff --git a/lua/conform/formatters/markdownlint-cli2.lua b/lua/conform/formatters/markdownlint-cli2.lua
new file mode 100644
index 0000000..69e4562
--- /dev/null
+++ b/lua/conform/formatters/markdownlint-cli2.lua
@@ -0,0 +1,11 @@
+---@type conform.FileFormatterConfig
+return {
+ meta = {
+ url = "https://github.com/DavidAnson/markdownlint-cli2",
+ description = "A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the markdownlint library",
+ },
+ command = "markdownlint-cli2",
+ args = { "--fix", "$FILENAME" },
+ exit_codes = { 0, 1 }, -- code 1 is returned when linting/formatter was successful and there were errors
+ stdin = false,
+}