3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/misc/gitlint/default.nix

51 lines
1 KiB
Nix
Raw Normal View History

2021-06-21 04:50:16 +01:00
{ lib
, buildPythonApplication
, fetchFromGitHub
, gitMinimal
2021-07-09 11:46:49 +01:00
, python3
2021-06-21 04:50:16 +01:00
}:
2021-12-04 18:36:49 +00:00
python3.pkgs.buildPythonApplication rec {
2021-06-21 04:50:16 +01:00
pname = "gitlint";
2021-12-04 18:36:49 +00:00
version = "0.17.0";
2021-06-21 04:50:16 +01:00
src = fetchFromGitHub {
owner = "jorisroovers";
repo = "gitlint";
rev = "v${version}";
2021-12-04 18:36:49 +00:00
sha256 = "sha256-RXBMb43BBiJ23X0eKC1kqgLw8iFKJnP5iejY0AWcUrU=";
2021-06-21 04:50:16 +01: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 04:50:16 +01:00
2021-12-04 18:36:49 +00:00
propagatedBuildInputs = with python3.pkgs; [
2021-06-21 04:50:16 +01: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 04:50:16 +01:00
'';
2021-12-04 18:36:49 +00:00
pythonImportsCheck = [
"gitlint"
2021-06-21 04:50:16 +01:00
];
2021-07-09 11:46:49 +01:00
meta = with lib; {
2021-06-21 04:50:16 +01:00
description = "Linting for your git commit messages";
2021-07-09 11:46:49 +01:00
homepage = "https://jorisroovers.com/gitlint/";
license = licenses.mit;
maintainers = with maintainers; [ ethancedwards8 fab ];
2021-06-21 04:50:16 +01:00
};
}