about summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-and-tools/gitlint/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/version-management/git-and-tools/gitlint/default.nix')
-rw-r--r--pkgs/applications/version-management/git-and-tools/gitlint/default.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/pkgs/applications/version-management/git-and-tools/gitlint/default.nix b/pkgs/applications/version-management/git-and-tools/gitlint/default.nix
new file mode 100644
index 0000000000000..626739864c713
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/gitlint/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, buildPythonApplication
+, fetchFromGitHub
+, gitMinimal
+, python3
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "gitlint";
+  version = "0.18.0";
+
+  src = fetchFromGitHub {
+    owner = "jorisroovers";
+    repo = "gitlint";
+    rev = "v${version}";
+    sha256 = "sha256-MmXzrooN+C9MUaAz4+IEGkGJWHbgvPMSLHgssM0wyN8=";
+  };
+
+  # Upstream splitted the project into gitlint and gitlint-core to
+  # simplify the dependency handling
+  sourceRoot = "source/gitlint-core";
+
+  propagatedBuildInputs = with python3.pkgs; [
+    arrow
+    click
+    sh
+  ];
+
+  checkInputs = with python3.pkgs; [
+    gitMinimal
+    pytestCheckHook
+  ];
+
+  postPatch = ''
+    # We don't need gitlint-core
+    substituteInPlace setup.py \
+      --replace "'gitlint-core[trusted-deps]==' + version," ""
+  '';
+
+  pythonImportsCheck = [
+    "gitlint"
+  ];
+
+  meta = with lib; {
+    description = "Linting for your git commit messages";
+    homepage = "https://jorisroovers.com/gitlint/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ethancedwards8 fab ];
+  };
+}