wanders created this revision. wanders added reviewers: phosek, isthismyaccount. Herald added a subscriber: whisperity. Herald added a project: All. wanders requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
When running scan-build-py's analyze-build script with output format set to sarif & html it wants to print a message on how to look at the defects mentioning the directory name twice. But the path argument was only given once to the logging function, causing "TypeError: not enough arguments for format string" exception. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D126974 Files: clang/tools/scan-build-py/lib/libscanbuild/analyze.py Index: clang/tools/scan-build-py/lib/libscanbuild/analyze.py =================================================================== --- clang/tools/scan-build-py/lib/libscanbuild/analyze.py +++ clang/tools/scan-build-py/lib/libscanbuild/analyze.py @@ -357,6 +357,7 @@ try: yield name finally: + args = (name,) if os.listdir(name): if output_format not in ['sarif', 'sarif-html']: # FIXME: # 'scan-view' currently does not support sarif format. @@ -364,6 +365,7 @@ elif output_format == 'sarif-html': msg = "Run 'scan-view %s' to examine bug reports or see " \ "merged sarif results at %s/results-merged.sarif." + args = (name, name) else: msg = "View merged sarif results at %s/results-merged.sarif." keep = True @@ -372,7 +374,7 @@ msg = "Report directory '%s' contains no report, but kept." else: msg = "Removing directory '%s' because it contains no report." - logging.warning(msg, name) + logging.warning(msg, *args) if not keep: os.rmdir(name)
Index: clang/tools/scan-build-py/lib/libscanbuild/analyze.py =================================================================== --- clang/tools/scan-build-py/lib/libscanbuild/analyze.py +++ clang/tools/scan-build-py/lib/libscanbuild/analyze.py @@ -357,6 +357,7 @@ try: yield name finally: + args = (name,) if os.listdir(name): if output_format not in ['sarif', 'sarif-html']: # FIXME: # 'scan-view' currently does not support sarif format. @@ -364,6 +365,7 @@ elif output_format == 'sarif-html': msg = "Run 'scan-view %s' to examine bug reports or see " \ "merged sarif results at %s/results-merged.sarif." + args = (name, name) else: msg = "View merged sarif results at %s/results-merged.sarif." keep = True @@ -372,7 +374,7 @@ msg = "Report directory '%s' contains no report, but kept." else: msg = "Removing directory '%s' because it contains no report." - logging.warning(msg, name) + logging.warning(msg, *args) if not keep: os.rmdir(name)
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits