How to use the cmake.codecheck.CodeCheck.CodeChecker function in cmake

To help you get started, we’ve selected a few cmake examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github widelands / widelands / cmake / codecheck / CodeCheck.py View on Github external
def check_files(files,color,benchmark):
        d = CodeChecker( benchmark = benchmark, color = color )
        for filename in files:
            errors = d.check_file(filename)

        # Print benchmark results
        if benchmark:
            print("\nBenchmark results:")

            res = d.benchmark_results
            ctime = sum( l[0] for l in res )

            for time,n in res:
                per = time/ctime * 100.
                percentage = ("%.2f%%"% per).rjust(8)
                time = ("%4.2fms"% (time*1000.)).rjust(8)
                print("%s %s    %s" % (percentage,time,n))