Skip to content

Commit

Permalink
feat: add support for lizard
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Sep 19, 2024
1 parent 19a213d commit 118cfec
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 16 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

| category | tools |
| --------------------- | ------------------------------------------------------------------------------------------------ |
| compiler and analyzer | llvm, gcc, msvc, apple-clang, vcvarsall, cppcheck, clang-tidy, clang-format, cpplint, flawfinder |
| build system | cmake, ninja, meson, make, task, bazel, cmakelang, cmake-format, cmake-lint |
| package manager | vcpkg, conan, choco, brew, nala |
| cache | ccache, sccache |
| documentation | doxygen, graphviz |
| coverage | gcovr, opencppcoverage, kcov |
| other | python, powershell, sevenzip |
| category | tools |
| --------------------- | -------------------------------------------------------------------------------------------------------- |
| 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 |
| package manager | vcpkg, conan, choco, brew, nala |
| cache | ccache, sccache |
| documentation | doxygen, graphviz |
| coverage | gcovr, opencppcoverage, kcov |
| other | python, powershell, sevenzip |

`setup-cpp` automatically handles the dependencies of the selected tool (e.g., `python` is required for `conan`).

Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ inputs:
flawfinder:
description: "Wether to install flawfinder (true/false) or the specific version to install."
required: false
lizard:
description: "Wether to install lizard (true/false) or the specific version to install."
required: false
clang-tidy:
description: "Wether to install clang-tidy (true/false) or the specific version to install."
required: false
Expand Down
2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.mjs.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/cli-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ All the available tools:
console.table(
{
"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": {
tools: "--cmake, --ninja, --meson, --make, --task, --bazel, --cmakelang, --cmake-lint, --cmake-format",
Expand Down
12 changes: 12 additions & 0 deletions src/lizard/__tests__/lizard.test.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 6 additions & 0 deletions src/lizard/lizard.ts
Original file line number Diff line number Diff line change
@@ -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)
}
6 changes: 4 additions & 2 deletions src/tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ import { setupCmake } from "./cmake/cmake.js"
import { setupCmakelang } from "./cmakelang/cmakelang.js"
import { setupConan } from "./conan/conan.js"
import { setupCppcheck } from "./cppcheck/cppcheck.js"
import { setupCpplint } from "./cpplint/cpplint.js"
import { setupDoxygen } from "./doxygen/doxygen.js"
import { setupFlawfinder } from "./flawfinder/flawfinder.js"
import { setupGcc, setupMingw } from "./gcc/gcc.js"
import { setupGcovr } from "./gcovr/gcovr.js"
import { setupGraphviz } from "./graphviz/graphviz.js"
import { setupKcov } from "./kcov/kcov.js"
import { setupLizard } from "./lizard/lizard.js"
import { setupAppleClang } from "./llvm/apple-clang.js"
import { setupClangFormat, setupClangTools, setupLLVM } from "./llvm/llvm.js"
import { setupMake } from "./make/make.js"
Expand All @@ -26,8 +29,6 @@ import { setupSevenZip } from "./sevenzip/sevenzip.js"
import { setupTask } from "./task/task.js"
import { setupVcpkg } from "./vcpkg/vcpkg.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 gccSetups = { gcc: setupGcc, "g++": setupGcc } as const
Expand Down Expand Up @@ -85,6 +86,7 @@ export const setups = {
cppcheck: setupCppcheck,
cpplint: setupCpplint,
flawfinder: setupFlawfinder,
lizard: setupLizard,
"clang-tidy": setupClangTools,
clangtidy: setupClangTools,
"clang-format": setupClangFormat,
Expand Down

0 comments on commit 118cfec

Please sign in to comment.