diff --git a/analyzer/codechecker_analyzer/analyzers/clangsa/analyzer.py b/analyzer/codechecker_analyzer/analyzers/clangsa/analyzer.py index e3ee1db988..05a175042f 100644 --- a/analyzer/codechecker_analyzer/analyzers/clangsa/analyzer.py +++ b/analyzer/codechecker_analyzer/analyzers/clangsa/analyzer.py @@ -179,7 +179,6 @@ def get_binary_version(self, configured_binary, environ, details=False) \ if details: version = [configured_binary, '--version'] else: - # FIXME version = [configured_binary, '-dumpversion'] try: output = subprocess.check_output(version, diff --git a/analyzer/codechecker_analyzer/analyzers/clangtidy/analyzer.py b/analyzer/codechecker_analyzer/analyzers/clangtidy/analyzer.py index 525f55d2aa..3d3530cfc4 100644 --- a/analyzer/codechecker_analyzer/analyzers/clangtidy/analyzer.py +++ b/analyzer/codechecker_analyzer/analyzers/clangtidy/analyzer.py @@ -204,12 +204,12 @@ def need_asterisk(checker: str) -> bool: return result -def parse_version(cppcheck_output): +def parse_version(tidy_output): """ Parse clang-tidy version output and return the version number. """ version_re = re.compile(r'.*version (?P[\d\.]+)', re.S) - match = version_re.match(cppcheck_output) + match = version_re.match(tidy_output) if match: return match.group('version') diff --git a/analyzer/codechecker_analyzer/arg.py b/analyzer/codechecker_analyzer/arg.py index fc41eada3e..afdc664dcc 100644 --- a/analyzer/codechecker_analyzer/arg.py +++ b/analyzer/codechecker_analyzer/arg.py @@ -18,8 +18,6 @@ 'AnalyzerConfig', ["analyzer", "option", "value"]) CheckerConfig = collections.namedtuple( "CheckerConfig", ["analyzer", "checker", "option", "value"]) -AnalyzerBinary = collections.namedtuple( - "AnalyzerBinary", ["analyzer", "path"]) class OrderedCheckersAction(argparse.Action): diff --git a/analyzer/codechecker_analyzer/cmd/analyzers.py b/analyzer/codechecker_analyzer/cmd/analyzers.py index a4952b13c4..861fd7b95c 100644 --- a/analyzer/codechecker_analyzer/cmd/analyzers.py +++ b/analyzer/codechecker_analyzer/cmd/analyzers.py @@ -62,8 +62,7 @@ def add_arguments_to_parser(parser): action='store_true', default=argparse.SUPPRESS, required=False, - help="Show details about the analyzers, not just " - "their names.") + help="DEPRECATED.") parser.add_argument('--dump-config', dest='dump_config', @@ -168,8 +167,7 @@ def uglify(text): "be the case, try to update your analyzer or check " "whether CodeChecker found the intended binary.") - rows = [(':'.join((analyzer_name, c[0])), c[1]) if 'details' in args - else (':'.join((analyzer_name, c[0])),) for c in configs] + rows = [(':'.join((analyzer_name, c[0])), c[1]) for c in configs] print(twodim.to_str(args.output_format, header, rows)) @@ -180,7 +178,7 @@ def uglify(text): return - header = ['Name', 'Version', 'Path'] + header = ['Name', 'Path', 'Version'] if args.output_format in ['csv', 'json']: header = list(map(uglify, header)) @@ -190,29 +188,14 @@ def uglify(text): analyzer_class = analyzer_types.supported_analyzers[analyzer_name] binary = context.analyzer_binaries.get(analyzer_name) check_env = context.analyzer_env - if 'details' not in args: - version = analyzer_class.get_binary_version(binary, check_env) - else: - version = analyzer_class.get_binary_version( - binary, check_env, details=True) + version = analyzer_class.get_binary_version(binary, check_env) if not version: version = 'ERROR' - rows.append([analyzer_name, version, binary]) + rows.append([analyzer_name, binary, version]) assert rows - if 'details' not in args: - print(twodim.to_str(args.output_format, header, rows)) - else: - for row in rows: - print(''.join(f""" -Analyzer name: {row[0]} -Path to binary: {row[2]} -Version info: - -{row[1]} ---------- -""")) + print(twodim.to_str(args.output_format, header, rows)) for analyzer_name, err_reason in errored: LOG.warning(f"Can't analyze with '{analyzer_name}': {err_reason}")