472aeafc57
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
77 lines
1.5 KiB
Nix
77 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
gibberish-detector,
|
|
mock,
|
|
pkgs,
|
|
pyahocorasick,
|
|
pytestCheckHook,
|
|
pythonOlder,
|
|
pyyaml,
|
|
requests,
|
|
responses,
|
|
setuptools,
|
|
unidiff,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "bc-detect-secrets";
|
|
version = "1.5.16";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "bridgecrewio";
|
|
repo = "detect-secrets";
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-SXwaZv7aki+lQvRe6S5SLF7UFvf3n9MaUFqw2Um8ENg=";
|
|
};
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
dependencies = [
|
|
pyyaml
|
|
requests
|
|
unidiff
|
|
];
|
|
|
|
optional-dependencies = {
|
|
word_list = [ pyahocorasick ];
|
|
gibberish = [ gibberish-detector ];
|
|
};
|
|
|
|
nativeCheckInputs = [
|
|
mock
|
|
pkgs.gitMinimal
|
|
pytestCheckHook
|
|
responses
|
|
] ++ lib.flatten (builtins.attrValues optional-dependencies);
|
|
|
|
preCheck = ''
|
|
export HOME=$(mktemp -d);
|
|
'';
|
|
|
|
disabledTests = [
|
|
# Tests are failing for various reasons (missing git repo, missing test data, etc.)
|
|
"test_baseline_filters_out_known_secrets"
|
|
"test_make_decisions"
|
|
"test_saves_to_baseline"
|
|
"test_start_halfway"
|
|
"TestCreate"
|
|
"TestDiff"
|
|
"TestGetFilesToScan"
|
|
"TestLineNumberChanges"
|
|
"TestModifiesBaselineFromVersionChange"
|
|
];
|
|
|
|
pythonImportsCheck = [ "detect_secrets" ];
|
|
|
|
meta = with lib; {
|
|
description = "Tool to detect secrets in the code";
|
|
homepage = "https://github.com/bridgecrewio/detect-secrets";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ fab ];
|
|
};
|
|
}
|