feat: add support for flawfinder

This commit is contained in:
Amin Yahyaabadi 2024-09-18 21:35:14 -07:00
parent aae4991f09
commit 19a213deb1
No known key found for this signature in database
GPG Key ID: F52AF77F636088F0
10 changed files with 37 additions and 14 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:
| category | tools |
| --------------------- | ------------------------------------------------------------------------------------ |
| compiler and analyzer | llvm, gcc, msvc, apple-clang, vcvarsall, cppcheck, clang-tidy, clang-format, cpplint |
| 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 |
| 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`).

View File

@ -58,6 +58,9 @@ inputs:
cpplint:
description: "Wether to install cpplint (true/false) or the specific version to install."
required: false
flawfinder:
description: "Wether to install flawfinder (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

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,7 @@ All the available tools:
console.table(
{
"compiler and analyzer": {
tools: "--llvm, --gcc, --msvc, --apple-clang, --vcvarsall, --cppcheck, --clang-tidy, --clang-format, --cpplint",
tools: "--llvm, --gcc, --msvc, --apple-clang, --vcvarsall, --cppcheck, --clang-tidy, --clang-format, --cpplint, --flawfinder",
},
"build system": {
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 { setupFlawfinder } from "../flawfinder.js"
jest.setTimeout(300000)
describe("setup-flawfinder", () => {
it("should setup flawfinder", async () => {
const installInfo = await setupFlawfinder(getVersion("flawfinder", "true", await ubuntuVersion()), "", process.arch)
await testBin("flawfinder", ["--version"], installInfo.binDir)
})
})

View File

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

View File

@ -27,6 +27,7 @@ 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
@ -83,6 +84,7 @@ export const setups = {
graphviz: setupGraphviz,
cppcheck: setupCppcheck,
cpplint: setupCpplint,
flawfinder: setupFlawfinder,
"clang-tidy": setupClangTools,
clangtidy: setupClangTools,
"clang-format": setupClangFormat,