depot/third_party/nixpkgs/pkgs/applications/version-management/gitlint/default.nix
Default email a0cb138ada Project import generated by Copybara.
GitOrigin-RevId: a100acd7bbf105915b0004427802286c37738fef
2023-02-02 18:25:31 +00:00

50 lines
1 KiB
Nix

{ lib
, buildPythonApplication
, fetchFromGitHub
, gitMinimal
, python3
}:
python3.pkgs.buildPythonApplication rec {
pname = "gitlint";
version = "0.18.0";
src = fetchFromGitHub {
owner = "jorisroovers";
repo = "gitlint";
rev = "v${version}";
sha256 = "sha256-MmXzrooN+C9MUaAz4+IEGkGJWHbgvPMSLHgssM0wyN8=";
};
# 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
];
nativeCheckInputs = 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 ];
};
}