From 9d94825d17d21a2be8af314fd2e6f06125358532 Mon Sep 17 00:00:00 2001 From: Dan Sully Date: Mon, 17 Oct 2022 08:36:36 -0700 Subject: [PATCH 1/2] feat: add commitlint --- lua/mason-registry/commitlint/init.lua | 12 ++++++++++++ lua/mason-registry/index.lua | 1 + lua/mason/mappings/language.lua | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 lua/mason-registry/commitlint/init.lua diff --git a/lua/mason-registry/commitlint/init.lua b/lua/mason-registry/commitlint/init.lua new file mode 100644 index 000000000..6aabe2608 --- /dev/null +++ b/lua/mason-registry/commitlint/init.lua @@ -0,0 +1,12 @@ +local Pkg = require "mason-core.package" +local _ = require "mason-core.functional" +local npm = require "mason-core.managers.npm" + +return Pkg.new { + name = "commitlint", + desc = "commitlint checks if your commit messages meet the conventional commit format.", + homepage = "https://commitlint.js.org/", + languages = { Pkg.Lang.GitCommit }, + categories = { Pkg.Cat.Linter }, + install = npm.packages { "@commitlint/cli", "@commitlint/config-conventional", "commitlint-format-json", bin = { "commitlint" } }, +} diff --git a/lua/mason-registry/index.lua b/lua/mason-registry/index.lua index 0f4519dd9..87bc381ac 100644 --- a/lua/mason-registry/index.lua +++ b/lua/mason-registry/index.lua @@ -36,6 +36,7 @@ return { codelldb = "mason-registry.codelldb", codeql = "mason-registry.codeql", codespell = "mason-registry.codespell", + commitlint = "mason-registry.commitlint", cpplint = "mason-registry.cpplint", cpptools = "mason-registry.cpptools", crystalline = "mason-registry.crystalline", diff --git a/lua/mason/mappings/language.lua b/lua/mason/mappings/language.lua index 19973863b..f3cd6b8ec 100644 --- a/lua/mason/mappings/language.lua +++ b/lua/mason/mappings/language.lua @@ -44,7 +44,7 @@ return { flow = { "prettier", "prettierd" }, flux = { "flux-lsp" }, fortran = { "fortls" }, - gitcommit = { "gitlint" }, + gitcommit = { "commitlint", "gitlint" }, go = { "delve", "djlint", "go-debug-adapter", "gofumpt", "goimports", "goimports-reviser", "golangci-lint", "golangci-lint-langserver", "golines", "gomodifytags", "gopls", "gotests", "gotestsum", "iferr", "impl", "json-to-struct", "revive", "staticcheck" }, gradle = { "gradle-language-server" }, graphql = { "graphql-language-service-cli", "prettier", "prettierd" }, From 36b8853128994556df1043e3c97a48bc5bed52fa Mon Sep 17 00:00:00 2001 From: Dan Sully Date: Mon, 17 Oct 2022 08:41:20 -0700 Subject: [PATCH 2/2] fix: style issue --- lua/mason-registry/commitlint/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/mason-registry/commitlint/init.lua b/lua/mason-registry/commitlint/init.lua index 6aabe2608..02f23ccfd 100644 --- a/lua/mason-registry/commitlint/init.lua +++ b/lua/mason-registry/commitlint/init.lua @@ -8,5 +8,10 @@ return Pkg.new { homepage = "https://commitlint.js.org/", languages = { Pkg.Lang.GitCommit }, categories = { Pkg.Cat.Linter }, - install = npm.packages { "@commitlint/cli", "@commitlint/config-conventional", "commitlint-format-json", bin = { "commitlint" } }, + install = npm.packages { + "@commitlint/cli", + "@commitlint/config-conventional", + "commitlint-format-json", + bin = { "commitlint" }, + }, }