nixpkgs/pkgs/tools/misc/gitlint/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.0 KiB
Nix
Raw Normal View History

2021-06-21 03:50:16 +00:00
{ lib
, buildPythonApplication
, fetchFromGitHub
, gitMinimal
2021-07-09 10:46:49 +00:00
, python3
2021-06-21 03:50:16 +00:00
}:
2021-12-04 18:36:49 +00:00
python3.pkgs.buildPythonApplication rec {
2021-06-21 03:50:16 +00:00
pname = "gitlint";
2021-12-04 18:36:49 +00:00
version = "0.17.0";
2021-06-21 03:50:16 +00:00
src = fetchFromGitHub {
owner = "jorisroovers";
repo = "gitlint";
rev = "v${version}";
2021-12-04 18:36:49 +00:00
sha256 = "sha256-RXBMb43BBiJ23X0eKC1kqgLw8iFKJnP5iejY0AWcUrU=";
2021-06-21 03:50:16 +00:00
};
2021-12-04 18:36:49 +00:00
# Upstream splitted the project into gitlint and gitlint-core to
# simplify the dependency handling
sourceRoot = "source/gitlint-core";
2021-06-21 03:50:16 +00:00
2021-12-04 18:36:49 +00:00
propagatedBuildInputs = with python3.pkgs; [
2021-06-21 03:50:16 +00:00
arrow
click
sh
];
2021-12-04 18:36:49 +00:00
checkInputs = with python3.pkgs; [
gitMinimal
pytestCheckHook
];
postPatch = ''
# We don't need gitlint-core
substituteInPlace setup.py \
--replace "'gitlint-core[trusted-deps]==' + version," ""
2021-06-21 03:50:16 +00:00
'';
2021-12-04 18:36:49 +00:00
pythonImportsCheck = [
"gitlint"
2021-06-21 03:50:16 +00:00
];
2021-07-09 10:46:49 +00:00
meta = with lib; {
2021-06-21 03:50:16 +00:00
description = "Linting for your git commit messages";
2021-07-09 10:46:49 +00:00
homepage = "https://jorisroovers.com/gitlint/";
license = licenses.mit;
maintainers = with maintainers; [ ethancedwards8 fab ];
2021-06-21 03:50:16 +00:00
};
}