Skip to content

Commit

Permalink
Just get rid of --details
Browse files Browse the repository at this point in the history
  • Loading branch information
Szelethus committed Oct 20, 2023
1 parent 4feec18 commit 6cab723
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions analyzer/codechecker_analyzer/analyzers/clangtidy/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<version>[\d\.]+)', re.S)
match = version_re.match(cppcheck_output)
match = version_re.match(tidy_output)
if match:
return match.group('version')

Expand Down
2 changes: 0 additions & 2 deletions analyzer/codechecker_analyzer/arg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
29 changes: 6 additions & 23 deletions analyzer/codechecker_analyzer/cmd/analyzers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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))

Expand All @@ -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))
Expand All @@ -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}")

0 comments on commit 6cab723

Please sign in to comment.