2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
gibberish-detector,
|
|
|
|
mock,
|
|
|
|
pkgs,
|
|
|
|
pyahocorasick,
|
|
|
|
pytest7CheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pyyaml,
|
|
|
|
requests,
|
|
|
|
responses,
|
|
|
|
unidiff,
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
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
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
mock
|
2024-04-21 15:54:59 +00:00
|
|
|
pytest7CheckHook
|
2021-02-05 17:12:51 +00:00
|
|
|
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
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "detect_secrets" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Enterprise friendly way of detecting and preventing secrets in code";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/Yelp/detect-secrets";
|
|
|
|
license = licenses.asl20;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|