aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpseudometa <73286100+chrisgrieser@users.noreply.github.com>2023-11-05 15:29:20 +0100
committerGitHub <noreply@github.com>2023-11-05 06:29:20 -0800
commitfa3cf1c40716492fd0df0c3dedd54c8018f9ea70 (patch)
treeda20782dfa532a57f3d5df22fdf21c9ab2f55f08
parent0bbe83830be5a07a1161bb1a23d7280310656177 (diff)
feat: add `ast-grep` (#177)
-rw-r--r--lua/conform/formatters/astgrep.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/lua/conform/formatters/astgrep.lua b/lua/conform/formatters/astgrep.lua
new file mode 100644
index 0000000..7e1a1cc
--- /dev/null
+++ b/lua/conform/formatters/astgrep.lua
@@ -0,0 +1,11 @@
+---@type conform.FileFormatterConfig
+return {
+ meta = {
+ url = "https://ast-grep.github.io/",
+ description = "A CLI tool for code structural search, lint and rewriting. Written in Rust",
+ },
+ command = "ast-grep",
+ args = { "scan", "--update-all", "$FILENAME" },
+ stdin = false,
+ exit_codes = { 0, 5 }, -- 5 = no config file exists
+}