Commit 73d2bda3 authored by Joel Goddard's avatar Joel Goddard
Browse files

tools/qa-checks: Add error trace and argument grouping



Full error traces are now printed for errors in check module files
to help locating errors.

Arguments are now formatted in groups based on the check module
they are from when printed in --help.

Issue-Id: SCM-3902
Signed-off-by: Joel Goddard's avatarJoel Goddard <joel.goddard@arm.com>
Change-Id: I4de1b9114f20c3bb300d040ea5752598d73a7387
parent 426824d2
......@@ -39,6 +39,7 @@ import shutil
import subprocess
import sys
import tempfile
import traceback
import venv
import abstract_check
......@@ -208,12 +209,14 @@ def parse_options():
name = check.name
list_args, args, _ = check.get_vars()
group = parser.add_argument_group(f"{name} check arguments")
for arg, msg in {**list_args, **args}.items():
prefix = ""
if arg in list_args:
prefix = "Comma-separated list: "
parser.add_argument(f"--{name}_{arg}", required=False,
help=(f"{prefix}{msg}"))
group.add_argument(f"--{name}_{arg}", required=False,
help=(f"{prefix}{msg}"))
default_config_file = "meta-ewaol-config/qa-checks/qa-checks_config.yml"
parser.add_argument("--config",
......@@ -615,7 +618,8 @@ def main():
except Exception as e:
logger.error(("Caught exception when executing the"
f" {checker.name} check:"))
logger.error(e)
logger.error(''.join(traceback.format_exception(
etype=type(e), value=e, tb=e.__traceback__)))
failed_modules.add(checker.name)
rc = 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment