depot/third_party/nixpkgs/pkgs/development/tools/analysis/cpplint/default.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

46 lines
1.1 KiB
Nix

{ lib, python3Packages, fetchFromGitHub }:
python3Packages.buildPythonApplication rec {
pname = "cpplint";
version = "1.6.1";
pyproject = true;
# Fetch from github instead of pypi, since the test cases are not in the pypi archive
src = fetchFromGitHub {
owner = "cpplint";
repo = "cpplint";
rev = "refs/tags/${version}";
hash = "sha256-N5YrlhEXQGYxhsJ4M5dGYZUzA81GKRSI83goaqbtCkI=";
};
postPatch = ''
substituteInPlace setup.py \
--replace-fail '"pytest-runner==5.2"' ""
patchShebangs cpplint_unittest.py
substituteInPlace cpplint_unittest.py \
--replace-fail "assertEquals" "assertEqual"
'';
build-system = with python3Packages; [
setuptools
];
nativeCheckInputs = with python3Packages; [
pytest
pytest-runner
];
checkPhase = ''
./cpplint_unittest.py
'';
meta = {
homepage = "https://github.com/cpplint/cpplint";
description = "Static code checker for C++";
mainProgram = "cpplint";
maintainers = [ lib.maintainers.bhipple ];
license = [ lib.licenses.bsd3 ];
};
}