Add format for zig (#991)

Co-authored-by: maxxnino <idonthaveemail@dontknow.com>
This commit is contained in:
maxxnino 2021-07-17 00:23:17 +09:00 committed by GitHub
parent 9b0292b003
commit 909b9cff87
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 4 deletions

View file

@ -161,3 +161,4 @@ require("lang.terraform").config()
require("lang.tex").config()
require("lang.vim").config()
require("lang.yaml").config()
require("lang.zig").config()

View file

@ -1,13 +1,30 @@
local M = {}
M.config = function()
-- TODO: implement config for language
return "No config available!"
O.lang.zig = {
formatter = {
exe = "zig",
args = { "fmt" },
stdin = false,
},
}
end
M.format = function()
-- TODO: implement formatter for language
return "No formatter available!"
O.formatters.filetype["zig"] = {
function()
return {
exe = O.lang.zig.formatter.exe,
args = O.lang.zig.formatter.args,
stdin = O.lang.zig.formatter.stdin,
}
end,
}
require("formatter.config").set_defaults {
logging = false,
filetype = O.formatters.filetype,
}
end
M.lint = function()