about summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-and-tools/gitlint/default.nix
blob: 626739864c7136ea8c1140162507a6c20b30d6e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 ];
  };
}