mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
feat(idf.py): add idf.py clang-check
and idf.py clang-html-report
This commit is contained in:
parent
064148212b
commit
5c19581bfe
@ -682,6 +682,14 @@ def init_cli(verbose_output=None):
|
||||
from idf_component_manager import idf_extensions
|
||||
extensions.append(('component_manager_ext', idf_extensions))
|
||||
|
||||
# Optional load `pyclang` for additional clang-tidy related functionalities
|
||||
try:
|
||||
from pyclang import idf_extension
|
||||
|
||||
extensions.append(('idf_clang_tidy_ext', idf_extension))
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
for name, extension in extensions:
|
||||
try:
|
||||
all_actions = merge_action_lists(all_actions, extension.action_extensions(all_actions, project_dir))
|
||||
|
@ -69,6 +69,10 @@ def action_extensions(base_actions, project_path):
|
||||
subprocess.check_output(GENERATORS[args.generator]['dry_run'] + [target_name], cwd=args.build_dir)
|
||||
|
||||
except Exception:
|
||||
if target_name in ['clang-check', 'clang-html-report']:
|
||||
raise FatalError('command "{}" requires an additional plugin "pyclang". '
|
||||
'Please install it via "pip install --upgrade pyclang"'.format(target_name))
|
||||
|
||||
raise FatalError(
|
||||
'command "%s" is not known to idf.py and is not a %s target' % (target_name, args.generator))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user