test-my-pr: add option --c-only
This commit is contained in:
parent
363dd309fd
commit
7bb2bd3ca0
|
@ -15,7 +15,7 @@ import shlex
|
||||||
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
|
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
|
||||||
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
|
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
|
||||||
# changes)
|
# changes)
|
||||||
CLIENT_VERSION = "1.3.33"
|
CLIENT_VERSION = "1.3.34"
|
||||||
|
|
||||||
# Timeout for analysis with Cppcheck in seconds
|
# Timeout for analysis with Cppcheck in seconds
|
||||||
CPPCHECK_TIMEOUT = 30 * 60
|
CPPCHECK_TIMEOUT = 30 * 60
|
||||||
|
@ -303,18 +303,22 @@ def download_package(work_path, package, bandwidth_limit):
|
||||||
return destfile
|
return destfile
|
||||||
|
|
||||||
|
|
||||||
def unpack_package(work_path, tgz, cpp_only=False, skip_files=None):
|
def unpack_package(work_path, tgz, cpp_only=False, c_only=False, skip_files=None):
|
||||||
print('Unpacking..')
|
print('Unpacking..')
|
||||||
temp_path = os.path.join(work_path, 'temp')
|
temp_path = os.path.join(work_path, 'temp')
|
||||||
__remove_tree(temp_path)
|
__remove_tree(temp_path)
|
||||||
os.mkdir(temp_path)
|
os.mkdir(temp_path)
|
||||||
|
|
||||||
header_endings = ('.hpp', '.h++', '.hxx', '.hh', '.h')
|
header_endings = ('.hpp', '.h++', '.hxx', '.hh', '.h')
|
||||||
source_endings = ('.cpp', '.c++', '.cxx', '.cc', '.tpp', '.txx', '.ipp', '.ixx', '.qml')
|
cpp_source_endings = ('.cpp', '.c++', '.cxx', '.cc', '.tpp', '.txx', '.ipp', '.ixx', '.qml')
|
||||||
c_source_endings = ('.c',)
|
c_source_endings = ('.c',)
|
||||||
|
|
||||||
if not cpp_only:
|
if cpp_only:
|
||||||
source_endings = source_endings + c_source_endings
|
source_endings = cpp_source_endings
|
||||||
|
elif c_only:
|
||||||
|
source_endings = c_source_endings
|
||||||
|
else:
|
||||||
|
source_endings = cpp_source_endings + c_source_endings
|
||||||
|
|
||||||
source_found = False
|
source_found = False
|
||||||
if tarfile.is_tarfile(tgz):
|
if tarfile.is_tarfile(tgz):
|
||||||
|
|
|
@ -26,6 +26,7 @@ if __name__ == "__main__":
|
||||||
group.add_argument('-p', default=256, type=int, help='Count of packages to check')
|
group.add_argument('-p', default=256, type=int, help='Count of packages to check')
|
||||||
group.add_argument('--packages', nargs='+', help='Check specific packages and then stop.')
|
group.add_argument('--packages', nargs='+', help='Check specific packages and then stop.')
|
||||||
parser.add_argument('-o', default='my_check_diff.log', help='Filename of result inside a working path dir')
|
parser.add_argument('-o', default='my_check_diff.log', help='Filename of result inside a working path dir')
|
||||||
|
parser.add_argument('--c-only', dest='c_only', help='Only process c packages', action='store_true')
|
||||||
parser.add_argument('--cpp-only', dest='cpp_only', help='Only process c++ packages', action='store_true')
|
parser.add_argument('--cpp-only', dest='cpp_only', help='Only process c++ packages', action='store_true')
|
||||||
parser.add_argument('--work-path', '--work-path=', default=lib.work_path, type=str, help='Working directory for reference repo')
|
parser.add_argument('--work-path', '--work-path=', default=lib.work_path, type=str, help='Working directory for reference repo')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
@ -123,7 +124,7 @@ if __name__ == "__main__":
|
||||||
print("No package downloaded")
|
print("No package downloaded")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
source_path, source_found = lib.unpack_package(work_path, tgz, args.cpp_only)
|
source_path, source_found = lib.unpack_package(work_path, tgz, c_only=args.c_only, cpp_only=args.cpp_only)
|
||||||
if not source_found:
|
if not source_found:
|
||||||
print("No files to process")
|
print("No files to process")
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue