mason.nvim icon indicating copy to clipboard operation
mason.nvim copied to clipboard

feat(registry): add cppcheck linter

Open VanillaBase1lb opened this issue 3 years ago • 5 comments
trafficstars

Add cppcheck to the registry. Since there is no official binary release for Linux, using make to compile it, suggestions and alternatives are welcomed.

This closes #353

VanillaBase1lb avatar Oct 15 '22 19:10 VanillaBase1lb

@williambotman /apply

diff --git a/lua/mason-registry/cppcheck/init.lua b/lua/mason-registry/cppcheck/init.lua
index 85f70527..7a60a839 100644
--- a/lua/mason-registry/cppcheck/init.lua
+++ b/lua/mason-registry/cppcheck/init.lua
@@ -2,10 +2,14 @@ local Pkg = require "mason-core.package"
 local Optional = require "mason-core.optional"
 local git = require "mason-core.managers.git"
 local github = require "mason-core.managers.github"
+local _ = require "mason-core.functional"
 
 return Pkg.new {
     name = "cppcheck",
-    desc = [[ Cppcheck is an analysis tool for C/C++ code. It detects the types of bugs that the compilers normally fail to detect. The goal is no false positives. ]],
+    desc = _.dedent [[
+        Cppcheck is an analysis tool for C/C++ code. It detects the types of bugs that the compilers normally fail to
+        detect. The goal is no false positives.
+    ]],
     homepage = "https://cppcheck.sourceforge.io/",
     languages = { Pkg.Lang.C, Pkg.Lang["C++"] },
     categories = { Pkg.Cat.Linter },

williamboman avatar Oct 17 '22 18:10 williamboman

I did not mean to force push, any way to undo this?

I still have the changes in my local repository, will reopen the PR.

VanillaBase1lb avatar Oct 17 '22 19:10 VanillaBase1lb

I did not mean to force push, any way to undo this?

I still have the changes in my local repository, will reopen the PR.

Ah no worries, cool :+1:. I've waited with merging this for now because I'd like to manually revise the install script and potentially harden it a bit more. Generally I try to avoid custom "low-level" install scripts due to difficulties in ensuring sufficient cross-platform support. The more long-term sustainable option for the time being might be to advise people to manage such packages elsewhere (cppcheck for instance seems to have broad support among real package managers)

williamboman avatar Oct 18 '22 13:10 williamboman

Hey @VanillaBase1lb I've not forgotten about this PR. I have however struggled to build this on some systems but have not yet had time to look into it more closely.

williamboman avatar Oct 29 '22 20:10 williamboman

No worries. Regarding not being able to build on some systems, is it an upstream(cppcheck) issue or something to do with Mason.nvim? Maybe we could help if there is more info on this.

VanillaBase1lb avatar Oct 30 '22 14:10 VanillaBase1lb

Closing this as packages are no longer added to this registry, see instead https://github.com/mason-org/mason-registry/.

williamboman avatar Mar 23 '23 18:03 williamboman