2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2021-08-22 07:53:02 +00:00
|
|
|
, buildPythonPackage
|
2021-02-05 17:12:51 +00:00
|
|
|
, fetchFromGitHub
|
2021-07-14 22:03:04 +00:00
|
|
|
, gibberish-detector
|
2021-02-05 17:12:51 +00:00
|
|
|
, mock
|
2021-12-06 16:07:01 +00:00
|
|
|
, pkgs
|
2021-02-05 17:12:51 +00:00
|
|
|
, pyahocorasick
|
|
|
|
, pytestCheckHook
|
2022-08-12 12:06:08 +00:00
|
|
|
, pythonOlder
|
2021-02-05 17:12:51 +00:00
|
|
|
, pyyaml
|
|
|
|
, requests
|
|
|
|
, responses
|
|
|
|
, unidiff
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "detect-secrets";
|
2022-10-06 18:32:54 +00:00
|
|
|
version = "1.4.0";
|
2022-08-12 12:06:08 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Yelp";
|
2021-02-05 17:12:51 +00:00
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2022-10-06 18:32:54 +00:00
|
|
|
hash = "sha256-6EmL6XPySqcA3EA+FFkfw7Dkxl5LvyBorIw0hesV5eU=";
|
2021-12-06 16:07:01 +00:00
|
|
|
leaveDotGit = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-07-14 22:03:04 +00:00
|
|
|
gibberish-detector
|
2021-02-05 17:12:51 +00:00
|
|
|
pyyaml
|
2021-07-14 22:03:04 +00:00
|
|
|
pyahocorasick
|
2021-02-05 17:12:51 +00:00
|
|
|
requests
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
checkInputs = [
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
responses
|
|
|
|
unidiff
|
2021-12-06 16:07:01 +00:00
|
|
|
pkgs.gitMinimal
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
disabledTests = [
|
2021-07-14 22:03:04 +00:00
|
|
|
# Tests are failing for various reasons. Needs to be adjusted with the next update
|
|
|
|
"test_basic"
|
|
|
|
"test_handles_each_path_separately"
|
|
|
|
"test_handles_multiple_directories"
|
|
|
|
"test_load_and_output"
|
|
|
|
"test_make_decisions"
|
2021-12-06 16:07:01 +00:00
|
|
|
"test_restores_line_numbers"
|
2021-07-14 22:03:04 +00:00
|
|
|
"test_saves_to_baseline"
|
|
|
|
"test_scan_all_files"
|
|
|
|
"test_start_halfway"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"detect_secrets"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "An enterprise friendly way of detecting and preventing secrets in code";
|
|
|
|
homepage = "https://github.com/Yelp/detect-secrets";
|
|
|
|
license = licenses.asl20;
|
2021-08-22 07:53:02 +00:00
|
|
|
maintainers = with maintainers; [ marsam ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|