diff --git a/pkgs/by-name/cp/cpplint/package.nix b/pkgs/by-name/cp/cpplint/package.nix index 4189b769b83a..e8f7c8ef8cf1 100644 --- a/pkgs/by-name/cp/cpplint/package.nix +++ b/pkgs/by-name/cp/cpplint/package.nix @@ -1,37 +1,26 @@ { lib, - fetchpatch, python3Packages, fetchFromGitHub, + versionCheckHook, }: python3Packages.buildPythonApplication rec { pname = "cpplint"; - version = "1.7.0"; + version = "2.0.0"; pyproject = true; - # Fetch from github instead of pypi, since the test cases are not in the pypi archive src = fetchFromGitHub { owner = "cpplint"; repo = "cpplint"; - # Commit where version was bumped to 1.7.0, no tag available - rev = "8f62396aff6dc850415cbe5ed7edf9dc95f4a731"; - hash = "sha256-EKD7vkxJjoKWfPrXEQRA0X3PyAoYXi9wGgUFT1zC4WM="; + rev = "refs/tags/${version}"; + hash = "sha256-076363ZwcriPb+Fn9S5jay8oL+LlBTNh+IqQRCAndRo="; }; - patches = [ - # Whitespace fixes that make the tests pass - (fetchpatch { - url = "https://github.com/cpplint/cpplint/commit/fd257bd78db02888cf6b5985ab8f53d6b765704f.patch"; - hash = "sha256-BNyW8QEY9fUe2zMG4RZzBHASaIsu4d2FJt5rX3VgkrQ="; - }) - ]; - postPatch = '' - substituteInPlace setup.py \ - --replace-fail '"pytest-runner==5.2"' "" - - patchShebangs cpplint_unittest.py + substituteInPlace setup.cfg \ + --replace-fail "pytest-cov" "" \ + --replace-fail "--cov-fail-under=90 --cov=cpplint" "" ''; build-system = with python3Packages; [ @@ -39,16 +28,18 @@ python3Packages.buildPythonApplication rec { ]; nativeCheckInputs = with python3Packages; [ - pytest + parameterized + pytestCheckHook + pytest-timeout + testfixtures + versionCheckHook ]; - - checkPhase = '' - ./cpplint_unittest.py - ''; + versionCheckProgramArg = [ "--version" ]; meta = { homepage = "https://github.com/cpplint/cpplint"; description = "Static code checker for C++"; + changelog = "https://github.com/cpplint/cpplint/releases/tag/${version}"; mainProgram = "cpplint"; maintainers = [ lib.maintainers.bhipple ]; license = [ lib.licenses.bsd3 ];