about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@users.noreply.github.com>2018-12-27 21:08:18 -0500
committerGitHub <noreply@github.com>2018-12-27 21:08:18 -0500
commit3ae459f3c0d78ed1d3032e711ab2fe8297ea32d5 (patch)
tree913608c26129fcfdc3abc83fc4d72bc26f53c017 /pkgs/development
parentbe3496fb6459766b403312c984881d31bf5fe948 (diff)
parent3258b00009e2108ec41d94e84fa49e1a7648d883 (diff)
downloadnixlib-3ae459f3c0d78ed1d3032e711ab2fe8297ea32d5.tar
nixlib-3ae459f3c0d78ed1d3032e711ab2fe8297ea32d5.tar.gz
nixlib-3ae459f3c0d78ed1d3032e711ab2fe8297ea32d5.tar.bz2
nixlib-3ae459f3c0d78ed1d3032e711ab2fe8297ea32d5.tar.lz
nixlib-3ae459f3c0d78ed1d3032e711ab2fe8297ea32d5.tar.xz
nixlib-3ae459f3c0d78ed1d3032e711ab2fe8297ea32d5.tar.zst
nixlib-3ae459f3c0d78ed1d3032e711ab2fe8297ea32d5.zip
Merge pull request #52876 from marsam/init-detect-secrets
detect-secrets: init at 0.11.0
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/unidiff/default.nix21
-rw-r--r--pkgs/development/tools/detect-secrets/default.nix34
2 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/unidiff/default.nix b/pkgs/development/python-modules/unidiff/default.nix
new file mode 100644
index 000000000000..81e9019f489c
--- /dev/null
+++ b/pkgs/development/python-modules/unidiff/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildPythonPackage, fetchFromGitHub }:
+
+buildPythonPackage rec {
+  pname = "unidiff";
+  version = "0.5.5";
+
+  # PyPI tarball doesn't ship tests
+  src = fetchFromGitHub {
+    owner = "matiasb";
+    repo = "python-unidiff";
+    rev = "v${version}";
+    sha256 = "1nvi7s1nn5p7j6aql1nkn2kiadnfby98yla5m3jq8xwsx0aplwdm";
+  };
+
+  meta = with lib; {
+    description = "Unified diff python parsing/metadata extraction library";
+    homepage = https://github.com/matiasb/python-unidiff;
+    license = licenses.mit;
+    maintainers = [ maintainers.marsam ];
+  };
+}
diff --git a/pkgs/development/tools/detect-secrets/default.nix b/pkgs/development/tools/detect-secrets/default.nix
new file mode 100644
index 000000000000..c341e2eb7101
--- /dev/null
+++ b/pkgs/development/tools/detect-secrets/default.nix
@@ -0,0 +1,34 @@
+{ lib, buildPythonApplication, fetchFromGitHub, isPy27, pyyaml, unidiff, configparser, enum34, future, functools32, mock, pytest }:
+
+buildPythonApplication rec {
+  pname = "detect-secrets";
+  version = "0.11.0";
+
+  # PyPI tarball doesn't ship tests
+  src = fetchFromGitHub {
+    owner = "Yelp";
+    repo = "detect-secrets";
+    rev = "v${version}";
+    sha256 = "11r11q6d8aajqqnhhz4lsa93qf1x745331kl9jd3z4y4w91l4gdz";
+  };
+
+  propagatedBuildInputs = [ pyyaml unidiff ]
+    ++ lib.optionals isPy27 [ configparser enum34 future functools32 ];
+
+  checkInputs = [ mock pytest ];
+
+  # deselect tests which require git setup
+  checkPhase = ''
+    PYTHONPATH=$PWD:$PYTHONPATH pytest \
+      --deselect tests/main_test.py::TestMain \
+      --deselect tests/pre_commit_hook_test.py::TestPreCommitHook \
+      --deselect tests/core/baseline_test.py::TestInitializeBaseline
+  '';
+
+  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;
+    maintainers = [ maintainers.marsam ];
+  };
+}