MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / create_compile_commands

Function create_compile_commands

test/cli/testutils.py:49–62  ·  view source on GitHub ↗
(compdb_file, files)

Source from the content-addressed store, hash-verified

47
48
49def create_compile_commands(compdb_file, files):
50 compdb = []
51 # TODO: bail out on empty list
52 for f in files:
53 compdb.append(
54 {
55 "file": str(f),
56 "directory": os.path.dirname(f),
57 "command": "gcc -c {}".format(os.path.basename(f))
58 }
59 )
60 compdb_j = json.dumps(compdb)
61 with open(compdb_file, 'wt') as f:
62 f.write(compdb_j)
63
64
65def __lookup_cppcheck_exe():

Callers 1

__test_showtimeFunction · 0.90

Calls 3

strFunction · 0.85
formatMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected