diff options
| author | Vu Le Thanh <thanhvule0310@gmail.com> | 2022-07-27 19:46:32 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-27 14:46:32 +0200 |
| commit | 269ee222f76e705619da2c0130c0a06e76419b88 (patch) | |
| tree | 8f5c1c6b6ec3eb6b7fe128174831ae73ddb5f8c7 /lua | |
| parent | fix(stylua): use prebuilt binary instead of building with cargo (#163) (diff) | |
| download | mason-269ee222f76e705619da2c0130c0a06e76419b88.tar mason-269ee222f76e705619da2c0130c0a06e76419b88.tar.gz mason-269ee222f76e705619da2c0130c0a06e76419b88.tar.bz2 mason-269ee222f76e705619da2c0130c0a06e76419b88.tar.lz mason-269ee222f76e705619da2c0130c0a06e76419b88.tar.xz mason-269ee222f76e705619da2c0130c0a06e76419b88.tar.zst mason-269ee222f76e705619da2c0130c0a06e76419b88.zip | |
feat: add alex, actionlint (#170)
Co-authored-by: William Boman <william@redwill.se>
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/mason-registry/actionlint/init.lua | 55 | ||||
| -rw-r--r-- | lua/mason-registry/alex/init.lua | 11 | ||||
| -rw-r--r-- | lua/mason-registry/index.lua | 2 | ||||
| -rw-r--r-- | lua/mason/mappings/language.lua | 4 |
4 files changed, 70 insertions, 2 deletions
diff --git a/lua/mason-registry/actionlint/init.lua b/lua/mason-registry/actionlint/init.lua new file mode 100644 index 00000000..4d6e71bb --- /dev/null +++ b/lua/mason-registry/actionlint/init.lua @@ -0,0 +1,55 @@ +local Pkg = require "mason-core.package" +local platform = require "mason-core.platform" +local _ = require "mason-core.functional" +local github = require "mason-core.managers.github" +local std = require "mason-core.managers.std" + +local coalesce, when = _.coalesce, _.when + +return Pkg.new { + name = "actionlint", + desc = [[Static checker for GitHub Actions workflow files]], + homepage = "https://github.com/rhysd/actionlint", + languages = { Pkg.Lang.YAML }, + categories = { Pkg.Cat.Linter }, + ---@async + ---@param ctx InstallContext + install = function(ctx) + local repo = "rhysd/actionlint" + local function format_release_file(file) + return _.compose(_.format(file), _.gsub("^v", "")) + end + + platform.when { + unix = function() + github + .untargz_release_file({ + repo = repo, + asset_file = coalesce( + when(platform.is.mac_x64, format_release_file "actionlint_%s_darwin_amd64.tar.gz"), + when(platform.is.mac_arm64, format_release_file "actionlint_%s_darwin_arm64.tar.gz"), + when(platform.is.linux_x64, format_release_file "actionlint_%s_linux_amd64.tar.gz"), + when(platform.is.linux_arm, format_release_file "actionlint_%s_linux_armv6.tar.gz"), + when(platform.is.linux_arm64, format_release_file "actionlint_%s_linux_arm64.tar.gz"), + when(platform.is.linux_x86, format_release_file "actionlint_%s_linux_386.tar.gz") + ), + }) + .with_receipt() + std.chmod("+x", { "actionlint" }) + end, + win = function() + github + .unzip_release_file({ + repo = repo, + asset_file = coalesce( + when(platform.is.win_arm64, format_release_file "actionlint_%s_windows_arm64.zip"), + when(platform.is.win_x64, format_release_file "actionlint_%s_windows_amd64.zip"), + when(platform.is.win_x86, format_release_file "actionlint_%s_windows_386.zip") + ), + }) + .with_receipt() + end, + } + ctx:link_bin("actionlint", platform.is.win and "actionlint.exe" or "actionlint") + end, +} diff --git a/lua/mason-registry/alex/init.lua b/lua/mason-registry/alex/init.lua new file mode 100644 index 00000000..67d40455 --- /dev/null +++ b/lua/mason-registry/alex/init.lua @@ -0,0 +1,11 @@ +local Pkg = require "mason-core.package" +local npm = require "mason-core.managers.npm" + +return Pkg.new { + name = "alex", + desc = [[Catch insensitive, inconsiderate writing]], + homepage = "https://github.com/get-alex/alex", + languages = { Pkg.Lang.Markdown }, + categories = { Pkg.Cat.Linter }, + install = npm.packages { "alex", bin = { "alex" } }, +} diff --git a/lua/mason-registry/index.lua b/lua/mason-registry/index.lua index 171f599c..70350232 100644 --- a/lua/mason-registry/index.lua +++ b/lua/mason-registry/index.lua @@ -1,6 +1,8 @@ -- THIS FILE IS GENERATED. DO NOT EDIT MANUALLY. -- stylua: ignore start return { + actionlint = "mason-registry.actionlint", + alex = "mason-registry.alex", ["angular-language-server"] = "mason-registry.angular-language-server", ["ansible-language-server"] = "mason-registry.ansible-language-server", ["apex-language-server"] = "mason-registry.apex-language-server", diff --git a/lua/mason/mappings/language.lua b/lua/mason/mappings/language.lua index 48282d88..86ea349a 100644 --- a/lua/mason/mappings/language.lua +++ b/lua/mason/mappings/language.lua @@ -60,7 +60,7 @@ return { less = { "css-lsp", "prettier", "prettierd" }, liquid = { "shopify-theme-check" }, lua = { "lemmy-help", "lua-language-server", "luacheck", "luaformatter", "selene", "stylua" }, - markdown = { "grammarly-languageserver", "ltex-ls", "markdownlint", "marksman", "prettier", "prettierd", "prosemd-lsp", "remark-language-server", "vale", "write-good", "zk" }, + markdown = { "alex", "grammarly-languageserver", "ltex-ls", "markdownlint", "marksman", "prettier", "prettierd", "prosemd-lsp", "remark-language-server", "vale", "write-good", "zk" }, ["metamath zero"] = { "metamath-zero-lsp" }, mksh = { "shfmt" }, mustache = { "djlint" }, @@ -107,6 +107,6 @@ return { vue = { "prettier", "prettierd", "vetur-vls", "vue-language-server" }, wgsl = { "wgsl-analyzer" }, xml = { "lemminx" }, - yaml = { "prettier", "prettierd", "yaml-language-server", "yamllint" }, + yaml = { "actionlint", "prettier", "prettierd", "yaml-language-server", "yamllint" }, zig = { "zls" } }
\ No newline at end of file |
