aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorJay Patel <36803168+jayp0521@users.noreply.github.com>2022-11-06 18:20:48 -0500
committerGitHub <noreply@github.com>2022-11-07 00:20:48 +0100
commit938c8fa89c0a0aeec4e56cb208a1f4ff77e71d3b (patch)
tree9a29bfc2257bcdcdc97028f34eb82b064c1be965 /lua
parenttest(ui): add test for ui border (#637) (diff)
downloadmason-938c8fa89c0a0aeec4e56cb208a1f4ff77e71d3b.tar
mason-938c8fa89c0a0aeec4e56cb208a1f4ff77e71d3b.tar.gz
mason-938c8fa89c0a0aeec4e56cb208a1f4ff77e71d3b.tar.bz2
mason-938c8fa89c0a0aeec4e56cb208a1f4ff77e71d3b.tar.lz
mason-938c8fa89c0a0aeec4e56cb208a1f4ff77e71d3b.tar.xz
mason-938c8fa89c0a0aeec4e56cb208a1f4ff77e71d3b.tar.zst
mason-938c8fa89c0a0aeec4e56cb208a1f4ff77e71d3b.zip
feat(registry): add protolint (#640)
Diffstat (limited to 'lua')
-rw-r--r--lua/mason-registry/index.lua1
-rw-r--r--lua/mason-registry/protolint/init.lua36
-rw-r--r--lua/mason/mappings/language.lua1
3 files changed, 38 insertions, 0 deletions
diff --git a/lua/mason-registry/index.lua b/lua/mason-registry/index.lua
index afec91bf..8cbbb8cb 100644
--- a/lua/mason-registry/index.lua
+++ b/lua/mason-registry/index.lua
@@ -160,6 +160,7 @@ return {
["prisma-language-server"] = "mason-registry.prisma-language-server",
proselint = "mason-registry.proselint",
["prosemd-lsp"] = "mason-registry.prosemd-lsp",
+ protolint = "mason-registry.protolint",
psalm = "mason-registry.psalm",
["puppet-editor-services"] = "mason-registry.puppet-editor-services",
["purescript-language-server"] = "mason-registry.purescript-language-server",
diff --git a/lua/mason-registry/protolint/init.lua b/lua/mason-registry/protolint/init.lua
new file mode 100644
index 00000000..205512d2
--- /dev/null
+++ b/lua/mason-registry/protolint/init.lua
@@ -0,0 +1,36 @@
+local Pkg = require "mason-core.package"
+local _ = require "mason-core.functional"
+local platform = require "mason-core.platform"
+local github = require "mason-core.managers.github"
+
+local coalesce, when = _.coalesce, _.when
+
+return Pkg.new {
+ name = "protolint",
+ desc = [[protolint is the pluggable linting/fixing utility for Protocol Buffer files (proto2+proto3)]],
+ homepage = "https://github.com/yoheimuta/protolint",
+ categories = { Pkg.Cat.Linter },
+ languages = { Pkg.Lang["proto"] },
+ install = function(ctx)
+ ---@param template_string string
+ local function release_file(template_string)
+ return _.compose(_.format(template_string), _.gsub("^v", ""))
+ end
+
+ github
+ .untargz_release_file({
+ repo = "yoheimuta/protolint",
+ asset_file = coalesce(
+ when(platform.is.mac_arm64, release_file "protolint_%s_Darwin_arm64.tar.gz"),
+ when(platform.is.mac_x64, release_file "protolint_%s_Darwin_x86_64.tar.gz"),
+ when(platform.is.linux_arm64, release_file "protolint_%s_Linux_arm64.tar.gz"),
+ when(platform.is.linux_x64, release_file "protolint_%s_Linux_x86_64.tar.gz"),
+ when(platform.is.win_arm64, release_file "protolint_%s_Windows_arm64.tar.gz"),
+ when(platform.is.win_x64, release_file "protolint_%s_Windows_x86_64.tar.gz")
+ ),
+ })
+ .with_receipt()
+ ctx:link_bin("protolint", platform.is.win and "protolint.exe" or "protolint")
+ ctx:link_bin("protoc-gen-protolint", platform.is.win and "protoc-gen-protolint.exe" or "protoc-gen-protolint")
+ end,
+}
diff --git a/lua/mason/mappings/language.lua b/lua/mason/mappings/language.lua
index a39cbfc7..41985c92 100644
--- a/lua/mason/mappings/language.lua
+++ b/lua/mason/mappings/language.lua
@@ -89,6 +89,7 @@ return {
php = { "intelephense", "php-cs-fixer", "php-debug-adapter", "phpactor", "phpcbf", "phpcs", "phpmd", "phpstan", "pint", "psalm" },
powershell = { "powershell-editor-services" },
prisma = { "prisma-language-server" },
+ proto = { "protolint" },
protobuf = { "buf", "buf-language-server" },
puppet = { "puppet-editor-services" },
purescript = { "purescript-language-server" },