about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/gitlint/default.nix
blob: c32171585969a74a89219cc27398adabf0b83c3e (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.17.0";

  src = fetchFromGitHub {
    owner = "jorisroovers";
    repo = "gitlint";
    rev = "v${version}";
    sha256 = "sha256-RXBMb43BBiJ23X0eKC1kqgLw8iFKJnP5iejY0AWcUrU=";
  };

  # 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 ];
  };
}