2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonApplication
|
|
|
|
, fetchFromGitHub
|
|
|
|
, gitMinimal
|
2021-07-14 22:03:04 +00:00
|
|
|
, python3
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2021-06-28 23:13:55 +00:00
|
|
|
pname = "gitlint";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.17.0";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jorisroovers";
|
|
|
|
repo = "gitlint";
|
|
|
|
rev = "v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-RXBMb43BBiJ23X0eKC1kqgLw8iFKJnP5iejY0AWcUrU=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# Upstream splitted the project into gitlint and gitlint-core to
|
|
|
|
# simplify the dependency handling
|
|
|
|
sourceRoot = "source/gitlint-core";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
2021-06-28 23:13:55 +00:00
|
|
|
arrow
|
|
|
|
click
|
|
|
|
sh
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +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-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"gitlint"
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
meta = with lib; {
|
2021-06-28 23:13:55 +00:00
|
|
|
description = "Linting for your git commit messages";
|
2021-07-14 22:03:04 +00:00
|
|
|
homepage = "https://jorisroovers.com/gitlint/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ethancedwards8 fab ];
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
}
|