1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-24 03:35:38 +03:00

testing/cpplint: new aport

This commit is contained in:
ptrcnull 2023-01-10 12:48:23 +01:00 committed by alice
parent 144fda98e4
commit 2b94993485
3 changed files with 85 additions and 0 deletions

34
testing/cpplint/APKBUILD Normal file
View file

@ -0,0 +1,34 @@
# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=cpplint
pkgver=1.6.1
pkgrel=0
pkgdesc="Static code checker for C++"
url="https://github.com/cpplint/cpplint"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-setuptools"
checkdepends="py3-pytest py3-pytest-runner py3-pytest-cov py3-testfixtures"
source="https://github.com/cpplint/cpplint/archive/refs/tags/$pkgver/cpplint-$pkgver.tar.gz
relax-dependencies.patch
remove-sre_compile.patch
"
build() {
python3 setup.py build
}
check() {
pytest
}
package() {
python3 setup.py install --skip-build --root="$pkgdir"
}
sha512sums="
be5c3c9044d862fc82e66987a76f3d01d5733c26774185fa3776b16943c3cb36d391bc20009940db744853df03614b47d88988c6823f8cda20b794b9075684cb cpplint-1.6.1.tar.gz
63aee43d3b5839a9bc8ef119ec0831ad54018fd3a6661ab51153a21aafc3c89c32463114d88c3821b92214dfdb34269f656dd993b00a7fe1fc3d7419f725658d relax-dependencies.patch
0a325aac30c451ab41305f21081d75525c1a370a0bc96f35b48b932a71270b5d89fb78d03946d0cdf1681d691db3a50f98c170f3a1a45e2db44aea906698a185 remove-sre_compile.patch
"

View file

@ -0,0 +1,13 @@
diff --git a/setup.py b/setup.py
index aef5c4e..55b32cb 100755
--- a/setup.py
+++ b/setup.py
@@ -73,7 +73,7 @@ setup(name='cpplint',
long_description=open('README.rst').read(),
license='BSD-3-Clause',
setup_requires=[
- "pytest-runner==5.2"
+ "pytest-runner>=5.2"
],
tests_require=test_required,
# extras_require allow pip install .[dev]

View file

@ -0,0 +1,38 @@
diff --git a/cpplint.py b/cpplint.py
index 42673f3..25b039c 100755
--- a/cpplint.py
+++ b/cpplint.py
@@ -54,7 +54,6 @@ import itertools
import math # for log
import os
import re
-import sre_compile
import string
import sys
import sysconfig
@@ -1049,7 +1048,7 @@ def Match(pattern, s):
# performance reasons; factoring it out into a separate function turns out
# to be noticeably expensive.
if pattern not in _regexp_compile_cache:
- _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
+ _regexp_compile_cache[pattern] = re.compile(pattern)
return _regexp_compile_cache[pattern].match(s)
@@ -1067,14 +1066,14 @@ def ReplaceAll(pattern, rep, s):
string with replacements made (or original string if no replacements)
"""
if pattern not in _regexp_compile_cache:
- _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
+ _regexp_compile_cache[pattern] = re.compile(pattern)
return _regexp_compile_cache[pattern].sub(rep, s)
def Search(pattern, s):
"""Searches the string for the pattern, caching the compiled regexp."""
if pattern not in _regexp_compile_cache:
- _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
+ _regexp_compile_cache[pattern] = re.compile(pattern)
return _regexp_compile_cache[pattern].search(s)