summary refs log tree commit diff
path: root/pkgs/applications/version-management/gitlint/default.nix
blob: 575cf96826d4c43b883929d6b4a59c7cb0acb08d (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
51
52
53
{ lib
, buildPythonApplication
, fetchFromGitHub
, gitMinimal
, python3
}:

python3.pkgs.buildPythonApplication rec {
  pname = "gitlint";
  version = "0.19.1";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "jorisroovers";
    repo = "gitlint";
    rev = "refs/tags/v${version}";
    hash = "sha256-4SGkkC4LjZXTDXwK6jMOIKXR1qX76CasOwSqv8XUrjs=";
  };

  SETUPTOOLS_SCM_PRETEND_VERSION = version;

  # Upstream splitted the project into gitlint and gitlint-core to
  # simplify the dependency handling
  sourceRoot = "${src.name}/gitlint-core";

  nativeBuildInputs = with python3.pkgs; [
    hatch-vcs
    hatchling
  ];

  propagatedBuildInputs = with python3.pkgs; [
    arrow
    click
    sh
  ];

  nativeCheckInputs = with python3.pkgs; [
    gitMinimal
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "gitlint"
  ];

  meta = with lib; {
    description = "Linting for your git commit messages";
    homepage = "https://jorisroovers.com/gitlint/";
    changelog = "https://github.com/jorisroovers/gitlint/releases/tag/v${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ ethancedwards8 fab ];
  };
}