1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonOlder,
7 tokenize-rt,
8}:
9
10buildPythonPackage rec {
11 pname = "add-trailing-comma";
12 version = "3.1.0";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.8";
16
17 src = fetchFromGitHub {
18 owner = "asottile";
19 repo = pname;
20 rev = "v${version}";
21 hash = "sha256-B+wjBy42RwabVz/6qEMGpB0JmwJ9hqSskwcNj4x/B/k=";
22 };
23
24 propagatedBuildInputs = [ tokenize-rt ];
25
26 pythonImportsCheck = [ "add_trailing_comma" ];
27
28 nativeCheckInputs = [ pytestCheckHook ];
29
30 meta = with lib; {
31 description = "Tool (and pre-commit hook) to automatically add trailing commas to calls and literals";
32 mainProgram = "add-trailing-comma";
33 homepage = "https://github.com/asottile/add-trailing-comma";
34 license = licenses.mit;
35 maintainers = with maintainers; [ gador ];
36 };
37}