nixpkgs/pkgs/applications/version-management/gitlint/default.nix
AndersonTorres d994dabace treewide: remove git-and-tools directory
We do not use a "plugin system" for Git addons anymore, and therefore this
directory is no longer useful. Indeed that directory is way more confusing,
given that it includes more than mere Git addons, going from Bitbucket server
command-line tools to complete rewrites of Git in exotic programming languages.

Also, without this directory, the mental load of decision-making reduces a lot.
When anyone is interested in including a new git-related tool, just put it into
pkgs/applications/version-management, without apologies.
2022-12-19 15:05:22 -03:00

51 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
];
checkInputs = 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 ];
};
}