From dc950e5717f1da65b1fcd986b1bbff0d6bd0e2ee Mon Sep 17 00:00:00 2001 From: Christian Johansen <80620482+chrhjoh@users.noreply.github.com> Date: Sat, 11 May 2024 05:57:29 +0200 Subject: feat: add snakefmt formatter for snakemake files (#399) --- README.md | 1 + doc/conform.txt | 2 ++ lua/conform/formatters/snakefmt.lua | 10 ++++++++++ 3 files changed, 13 insertions(+) create mode 100644 lua/conform/formatters/snakefmt.lua diff --git a/README.md b/README.md index 5cb4c28..71618c7 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,7 @@ You can view this list in vim with `:help conform-formatters` - [shellharden](https://github.com/anordal/shellharden) - The corrective bash syntax highlighter. - [shfmt](https://github.com/mvdan/sh) - A shell parser, formatter, and interpreter with `bash` support. - [smlfmt](https://github.com/shwestrick/smlfmt) - A custom parser and code formatter for Standard ML. +- [snakefmt](https://github.com/snakemake/snakefmt) - a formatting tool for Snakemake files following the design of Black. - [sql_formatter](https://github.com/sql-formatter-org/sql-formatter) - A whitespace formatter for different query languages. - [sqlfluff](https://github.com/sqlfluff/sqlfluff) - A modular SQL linter and auto-formatter with support for multiple dialects and templated code. - [sqlfmt](https://docs.sqlfmt.com) - sqlfmt formats your dbt SQL files so you don't have to. It is similar in nature to Black, gofmt, and rustfmt (but for SQL) diff --git a/doc/conform.txt b/doc/conform.txt index 7e5041a..e3f38d6 100644 --- a/doc/conform.txt +++ b/doc/conform.txt @@ -327,6 +327,8 @@ FORMATTERS *conform-formatter `shellharden` - The corrective bash syntax highlighter. `shfmt` - A shell parser, formatter, and interpreter with `bash` support. `smlfmt` - A custom parser and code formatter for Standard ML. +`snakefmt` - a formatting tool for Snakemake files following the design of + Black. `sql_formatter` - A whitespace formatter for different query languages. `sqlfluff` - A modular SQL linter and auto-formatter with support for multiple dialects and templated code. diff --git a/lua/conform/formatters/snakefmt.lua b/lua/conform/formatters/snakefmt.lua new file mode 100644 index 0000000..fccdeaa --- /dev/null +++ b/lua/conform/formatters/snakefmt.lua @@ -0,0 +1,10 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://github.com/snakemake/snakefmt", + description = "a formatting tool for Snakemake files following the design of Black.", + }, + command = "snakefmt", + args = "$FILENAME", + stdin = false, +} -- cgit v1.2.3-70-g09d2