Update generated neovim config
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/rokucommunity/brighterscript-formatter",
|
||||
description = "A code formatter for BrighterScript (and BrightScript).",
|
||||
},
|
||||
command = "bsfmt",
|
||||
args = { "$FILENAME", "--write" },
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://caramel.run/manual/reference/cli/fmt.html",
|
||||
description = "Format Caramel code.",
|
||||
},
|
||||
command = "caramel",
|
||||
args = { "fmt", "$FILENAME" },
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/cockroachdb/crlfmt",
|
||||
description = "Formatter for CockroachDB's additions to the Go style guide.",
|
||||
},
|
||||
command = "crlfmt",
|
||||
args = { "-w", "$FILENAME" },
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/terrastruct/d2",
|
||||
description = "D2 is a modern diagram scripting language that turns text to diagrams.",
|
||||
},
|
||||
command = "d2",
|
||||
args = { "fmt", "-" },
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://dcm.dev/docs/cli/formatting/fix/",
|
||||
description = "Fixes issues produced by dcm analyze, dcm check-unused-code or dcm check-dependencies commands.",
|
||||
},
|
||||
command = "dcm",
|
||||
args = { "fix", "$FILENAME" },
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://dcm.dev/docs/cli/formatting/format/",
|
||||
description = "Formats .dart files.",
|
||||
},
|
||||
command = "dcm",
|
||||
args = { "format", "$FILENAME" },
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://pypi.org/project/docformatter/",
|
||||
description = "docformatter automatically formats docstrings to follow a subset of the PEP 257 conventions.",
|
||||
},
|
||||
command = "docformatter",
|
||||
args = { "--in-place", "$FILENAME" },
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/LilSpazJoekp/docstrfmt",
|
||||
description = "reStructuredText formatter.",
|
||||
},
|
||||
command = "docstrfmt",
|
||||
stdin = true,
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/thlorenz/doctoc",
|
||||
description = "Generates table of contents for markdown files inside local git repository.",
|
||||
},
|
||||
command = "doctoc",
|
||||
stdin = false,
|
||||
args = {
|
||||
"$FILENAME",
|
||||
},
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/sile/efmt",
|
||||
description = "Erlang code formatter.",
|
||||
},
|
||||
command = "efmt",
|
||||
args = { "-" },
|
||||
stdin = true,
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/WhatsApp/erlfmt",
|
||||
description = "An automated code formatter for Erlang.",
|
||||
},
|
||||
command = "erlfmt",
|
||||
args = { "-w", "$FILENAME" },
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/wvermin/findent",
|
||||
description = "Indent, relabel and convert Fortran sources.",
|
||||
},
|
||||
command = "findent",
|
||||
stdin = true,
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
---@return nil|string
|
||||
local function get_format_script()
|
||||
return vim.api.nvim_get_runtime_file("scripts/format-queries.lua", false)[1]
|
||||
end
|
||||
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter/blob/main/CONTRIBUTING.md#formatting",
|
||||
description = "Tree-sitter query formatter.",
|
||||
},
|
||||
condition = function()
|
||||
local ok = pcall(vim.treesitter.language.inspect, "query")
|
||||
return ok and get_format_script() ~= nil
|
||||
end,
|
||||
command = "nvim",
|
||||
args = function()
|
||||
local script = get_format_script()
|
||||
assert(script)
|
||||
-- Manually set the runtimepath to put nvim-treesitter first. The format-queries script relies
|
||||
-- on the nvim-treesitter parser; the one bundled with Neovim may be outdated.
|
||||
local rtp = vim.fn.fnamemodify(script, ":h:h")
|
||||
return { "-c", "set rtp^=" .. rtp, "-l", script, "$FILENAME" }
|
||||
end,
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/fortran-lang/fprettify",
|
||||
description = "Auto-formatter for modern fortran source code.",
|
||||
},
|
||||
command = "fprettify",
|
||||
args = {
|
||||
-- --silent is recommended for editor integrations https://github.com/fortran-lang/fprettify?tab=readme-ov-file#editor-integration
|
||||
"--silent",
|
||||
"-",
|
||||
},
|
||||
stdin = true,
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/gluon-lang/gluon",
|
||||
description = "Code formatting for the gluon programming language.",
|
||||
},
|
||||
command = "gluon",
|
||||
args = { "fmt", "$FILENAME" },
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://grain-lang.org/docs/tooling/grain_cli#grain-format",
|
||||
description = "Code formatter for the grain programming language.",
|
||||
},
|
||||
command = "grain",
|
||||
args = { "format", "$FILENAME" },
|
||||
stdin = true,
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/mihaimaruseac/hindent",
|
||||
description = "Haskell pretty printer.",
|
||||
},
|
||||
command = "hindent",
|
||||
args = { "$FILENAME" },
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://imba.io/",
|
||||
description = "Code formatter for the Imba programming language.",
|
||||
},
|
||||
command = "imba",
|
||||
stdin = false,
|
||||
-- `-f` is used to ignore the git status of the file.
|
||||
args = { "fmt", "-f", "$FILENAME" },
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://www.kcl-lang.io/docs/tools/cli/kcl/fmt",
|
||||
description = "The KCL Format tool modifies the files according to the KCL code style.",
|
||||
},
|
||||
command = "kcl",
|
||||
args = { "fmt", "$FILENAME" },
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://repo.or.cz/llf.git",
|
||||
description = "A LaTeX reformatter / beautifier.",
|
||||
},
|
||||
command = "llf",
|
||||
stdin = true,
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/Koihik/LuaFormatter",
|
||||
description = "Code formatter for Lua.",
|
||||
},
|
||||
command = "lua-format",
|
||||
stdin = true,
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://nickel-lang.org/",
|
||||
description = "Code formatter for the Nickel programming language.",
|
||||
},
|
||||
command = "nickel",
|
||||
stdin = false,
|
||||
args = { "format", "$FILENAME" },
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/nvuillam/npm-groovy-lint",
|
||||
description = "Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line.",
|
||||
},
|
||||
command = "npm-groovy-lint",
|
||||
args = { "--fix", "$FILENAME" },
|
||||
-- https://github.com/nvuillam/npm-groovy-lint/blob/14e2649ff7ca642dba3e901c17252b178bea8b1b/lib/groovy-lint.js#L48
|
||||
exit_codes = { 0, 1 }, -- 1 = expected error
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/google/pyink",
|
||||
description = "A Python formatter, forked from Black with a few different formatting behaviors.",
|
||||
},
|
||||
command = "pyink",
|
||||
args = {
|
||||
"--stdin-filename",
|
||||
"$FILENAME",
|
||||
"--quiet",
|
||||
"-",
|
||||
},
|
||||
stdin = true,
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/dzhu/rstfmt",
|
||||
description = "A formatter for reStructuredText.",
|
||||
},
|
||||
command = "rstfmt",
|
||||
args = { "$FILENAME" },
|
||||
stdin = false,
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/nrempel/sleek",
|
||||
description = "Sleek is a CLI tool for formatting SQL.",
|
||||
},
|
||||
command = "sleek",
|
||||
stdin = true,
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/haskell/stylish-haskell",
|
||||
description = "Haskell code prettifier.",
|
||||
},
|
||||
command = "stylish-haskell",
|
||||
args = {},
|
||||
stdin = true,
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/realm/SwiftLint",
|
||||
description = "A tool to enforce Swift style and conventions.",
|
||||
},
|
||||
command = "swiftlint",
|
||||
stdin = true,
|
||||
args = { "lint", "--use-stdin", "--fix", "--format" },
|
||||
cwd = require("conform.util").root_file({ ".swiftlint.yml", "Package.swift" }),
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
local config_files = {
|
||||
"vsg_config.yaml",
|
||||
"vsg_config.yml",
|
||||
"vsg_config.json",
|
||||
"vsg.yaml",
|
||||
"vsg.yml",
|
||||
"vsg.json",
|
||||
".vsg_config.yaml",
|
||||
".vsg_config.yml",
|
||||
".vsg_config.json",
|
||||
".vsg.yaml",
|
||||
".vsg.yml",
|
||||
".vsg.json",
|
||||
}
|
||||
|
||||
local function find_config(dirname)
|
||||
local paths = {
|
||||
dirname,
|
||||
(os.getenv("XDG_CONFIG_HOME") or os.getenv("HOME") .. "/.config") .. "/vsg",
|
||||
}
|
||||
|
||||
for _, path in ipairs(paths) do
|
||||
local config = vim.fs.find(config_files, {
|
||||
path = path,
|
||||
upward = path == dirname,
|
||||
})[1]
|
||||
if config then
|
||||
return config
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---@type conform.FileFormatterConfig
|
||||
return {
|
||||
meta = {
|
||||
url = "https://github.com/jeremiah-c-leary/vhdl-style-guide",
|
||||
description = "Style guide enforcement for VHDL.",
|
||||
},
|
||||
command = "vsg",
|
||||
stdin = false,
|
||||
args = function(_, ctx)
|
||||
local args = { "-of", "syntastic", "--fix", "-f", "$FILENAME" }
|
||||
local config_file = find_config(ctx.dirname)
|
||||
|
||||
if config_file then
|
||||
table.insert(args, "-c")
|
||||
table.insert(args, config_file)
|
||||
end
|
||||
|
||||
return args
|
||||
end,
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
return {
|
||||
elixir = "ex",
|
||||
graphql = "gql",
|
||||
javascript = "js",
|
||||
javascriptreact = "jsx",
|
||||
markdown = "md",
|
||||
perl = "pl",
|
||||
python = "py",
|
||||
ruby = "rb",
|
||||
rust = "rs",
|
||||
typescript = "ts",
|
||||
typescriptreact = "tsx",
|
||||
}
|
||||
Reference in New Issue
Block a user