about summary refs log tree commit diff
path: root/pkgs/by-name/cm/cmake-lint/package.nix
blob: fd1c95165c350c1889354f42eb2ce8059c60fc13 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
  lib,
  fetchFromGitHub,
  python3Packages,
  testers,
  cmake-lint,
}:

python3Packages.buildPythonApplication rec {
  pname = "cmake-lint";
  version = "1.4.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "cmake-lint";
    repo = "cmake-lint";
    rev = "refs/tags/${version}";
    hash = "sha256-/OuWwerBlJynEibaYo+jkLpHt4x9GZrqMRJNxgrDBlM=";
  };

  postPatch = ''
    # We don't need to test coverage, so remove these checks
    substituteInPlace setup.cfg \
      --replace-fail "addopts = --cov-fail-under=84 --cov=./cmakelint" ""
  '';

  build-system = [ python3Packages.setuptools ];

  pythonImportsCheck = [ "cmakelint" ];

  nativeCheckInputs = [
    python3Packages.pytestCheckHook
  ];

  passthru.tests = {
    version = testers.testVersion { package = cmake-lint; };
  };

  meta = {
    description = "Static code checker for CMake files";
    homepage = "https://github.com/cmake-lint/cmake-lint";
    changelog = "https://github.com/cmake-lint/cmake-lint/releases/tag/${version}";
    license = lib.licenses.asl20;
    maintainers = [ lib.maintainers.luftmensch-luftmensch ];
    mainProgram = "cmakelint";
  };
}