feat: add support for lizard

This commit is contained in:
Amin Yahyaabadi 2024-09-18 21:39:36 -07:00
parent 19a213deb1
commit 118cfec161
No known key found for this signature in database
GPG Key ID: F52AF77F636088F0
10 changed files with 40 additions and 16 deletions

View File

@ -14,15 +14,15 @@ Setting up a **cross-platform** environment for building and testing C++/C proje
`setup-cpp` is **modular** and you can choose to install any of these tools: `setup-cpp` is **modular** and you can choose to install any of these tools:
| category | tools | | category | tools |
| --------------------- | ------------------------------------------------------------------------------------------------ | | --------------------- | -------------------------------------------------------------------------------------------------------- |
| compiler and analyzer | llvm, gcc, msvc, apple-clang, vcvarsall, cppcheck, clang-tidy, clang-format, cpplint, flawfinder | | compiler and analyzer | llvm, gcc, msvc, apple-clang, vcvarsall, cppcheck, clang-tidy, clang-format, cpplint, flawfinder, lizard |
| build system | cmake, ninja, meson, make, task, bazel, cmakelang, cmake-format, cmake-lint | | build system | cmake, ninja, meson, make, task, bazel, cmakelang, cmake-format, cmake-lint |
| package manager | vcpkg, conan, choco, brew, nala | | package manager | vcpkg, conan, choco, brew, nala |
| cache | ccache, sccache | | cache | ccache, sccache |
| documentation | doxygen, graphviz | | documentation | doxygen, graphviz |
| coverage | gcovr, opencppcoverage, kcov | | coverage | gcovr, opencppcoverage, kcov |
| other | python, powershell, sevenzip | | other | python, powershell, sevenzip |
`setup-cpp` automatically handles the dependencies of the selected tool (e.g., `python` is required for `conan`). `setup-cpp` automatically handles the dependencies of the selected tool (e.g., `python` is required for `conan`).

View File

@ -61,6 +61,9 @@ inputs:
flawfinder: flawfinder:
description: "Wether to install flawfinder (true/false) or the specific version to install." description: "Wether to install flawfinder (true/false) or the specific version to install."
required: false required: false
lizard:
description: "Wether to install lizard (true/false) or the specific version to install."
required: false
clang-tidy: clang-tidy:
description: "Wether to install clang-tidy (true/false) or the specific version to install." description: "Wether to install clang-tidy (true/false) or the specific version to install."
required: false required: false

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -33,7 +33,8 @@ All the available tools:
console.table( console.table(
{ {
"compiler and analyzer": { "compiler and analyzer": {
tools: "--llvm, --gcc, --msvc, --apple-clang, --vcvarsall, --cppcheck, --clang-tidy, --clang-format, --cpplint, --flawfinder", tools:
"--llvm, --gcc, --msvc, --apple-clang, --vcvarsall, --cppcheck, --clang-tidy, --clang-format, --cpplint, --flawfinder, --lizard",
}, },
"build system": { "build system": {
tools: "--cmake, --ninja, --meson, --make, --task, --bazel, --cmakelang, --cmake-lint, --cmake-format", tools: "--cmake, --ninja, --meson, --make, --task, --bazel, --cmakelang, --cmake-lint, --cmake-format",

View File

@ -0,0 +1,12 @@
import { ubuntuVersion } from "../../utils/env/ubuntu_version.js"
import { testBin } from "../../utils/tests/test-helpers.js"
import { getVersion } from "../../versions/versions.js"
import { setupLizard } from "../lizard.js"
jest.setTimeout(300000)
describe("setup-lizard", () => {
it("should setup lizard", async () => {
const installInfo = await setupLizard(getVersion("lizard", "true", await ubuntuVersion()), "", process.arch)
await testBin("lizard", ["--version"], installInfo.binDir)
})
})

6
src/lizard/lizard.ts Normal file
View File

@ -0,0 +1,6 @@
import { setupPipPack } from "../utils/setup/setupPipPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupLizard(version: string | undefined, _setupDir: string, _arch: string) {
return setupPipPack("lizard", version)
}

View File

@ -6,11 +6,14 @@ import { setupCmake } from "./cmake/cmake.js"
import { setupCmakelang } from "./cmakelang/cmakelang.js" import { setupCmakelang } from "./cmakelang/cmakelang.js"
import { setupConan } from "./conan/conan.js" import { setupConan } from "./conan/conan.js"
import { setupCppcheck } from "./cppcheck/cppcheck.js" import { setupCppcheck } from "./cppcheck/cppcheck.js"
import { setupCpplint } from "./cpplint/cpplint.js"
import { setupDoxygen } from "./doxygen/doxygen.js" import { setupDoxygen } from "./doxygen/doxygen.js"
import { setupFlawfinder } from "./flawfinder/flawfinder.js"
import { setupGcc, setupMingw } from "./gcc/gcc.js" import { setupGcc, setupMingw } from "./gcc/gcc.js"
import { setupGcovr } from "./gcovr/gcovr.js" import { setupGcovr } from "./gcovr/gcovr.js"
import { setupGraphviz } from "./graphviz/graphviz.js" import { setupGraphviz } from "./graphviz/graphviz.js"
import { setupKcov } from "./kcov/kcov.js" import { setupKcov } from "./kcov/kcov.js"
import { setupLizard } from "./lizard/lizard.js"
import { setupAppleClang } from "./llvm/apple-clang.js" import { setupAppleClang } from "./llvm/apple-clang.js"
import { setupClangFormat, setupClangTools, setupLLVM } from "./llvm/llvm.js" import { setupClangFormat, setupClangTools, setupLLVM } from "./llvm/llvm.js"
import { setupMake } from "./make/make.js" import { setupMake } from "./make/make.js"
@ -26,8 +29,6 @@ import { setupSevenZip } from "./sevenzip/sevenzip.js"
import { setupTask } from "./task/task.js" import { setupTask } from "./task/task.js"
import { setupVcpkg } from "./vcpkg/vcpkg.js" import { setupVcpkg } from "./vcpkg/vcpkg.js"
import { setupVCVarsall } from "./vcvarsall/vcvarsall.js" import { setupVCVarsall } from "./vcvarsall/vcvarsall.js"
import { setupCpplint } from "./cpplint/cpplint.js"
import { setupFlawfinder } from "./flawfinder/flawfinder.js"
export const llvmSetups = { llvm: setupLLVM, clang: setupLLVM, "clang++": setupLLVM } as const export const llvmSetups = { llvm: setupLLVM, clang: setupLLVM, "clang++": setupLLVM } as const
export const gccSetups = { gcc: setupGcc, "g++": setupGcc } as const export const gccSetups = { gcc: setupGcc, "g++": setupGcc } as const
@ -85,6 +86,7 @@ export const setups = {
cppcheck: setupCppcheck, cppcheck: setupCppcheck,
cpplint: setupCpplint, cpplint: setupCpplint,
flawfinder: setupFlawfinder, flawfinder: setupFlawfinder,
lizard: setupLizard,
"clang-tidy": setupClangTools, "clang-tidy": setupClangTools,
clangtidy: setupClangTools, clangtidy: setupClangTools,
"clang-format": setupClangFormat, "clang-format": setupClangFormat,