MCPcopy Create free account
hub / github.com/catboost/catboost / main

Function main

tools/cpp_style_checker/wrapper.py:12–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def main():
13 params = linter_params.get_params()
14
15 if 'custom_clang_format' in params.extra_params:
16 dep_result = next(
17 (
18 PurePath(params.depends[dep])
19 for dep in params.depends
20 if str(PurePath(dep).parent) == params.extra_params['custom_clang_format']
21 ),
22 None,
23 )
24 if dep_result is None:
25 raise Exception('Could not find clang-format binary')
26
27 if 'custom_clang_format_bin' in params.extra_params:
28 # dep_result is not a clang-format binary (package etc)
29 clang_format_binary = str(dep_result.parent / params.extra_params['custom_clang_format_bin'])
30 else:
31 # dep_result is a clang-format binary
32 clang_format_binary = str(dep_result)
33 else:
34 clang_format_binary = os.path.join(params.global_resources[CLANG_FORMAT_RESOURCE], 'clang-format')
35
36 style_config_path = params.configs[0]
37
38 report = reporter.LintReport()
39 for file_name in params.files:
40 start_time = time.perf_counter()
41 status, message = check_file(clang_format_binary, style_config_path, file_name)
42 elapsed = time.perf_counter() - start_time
43 report.add(file_name, status, message, elapsed=elapsed)
44
45 report.dump(params.report_file)
46
47
48def check_file(clang_format_binary, style_config_path, filename):

Callers 1

wrapper.pyFile · 0.70

Calls 7

check_fileFunction · 0.85
nextFunction · 0.50
strClass · 0.50
get_paramsMethod · 0.45
joinMethod · 0.45
addMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected