From: Andrea Righi Date: Fri, 7 Jul 2023 08:29:59 +0000 (+0200) Subject: annotations: make the output of config-check more user-friendly X-Git-Tag: v0.2~21 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=5972b4cf5c94314bd95261a77ec01126f9a1610a;p=annotations.git annotations: make the output of config-check more user-friendly In case of a config change we shouldn't print an error, but a nicer message instead explaining that the option simply changed. Hopefully this will help to avoid all the misunderstanding that usually happens by priting a normal change as an error. Signed-off-by: Andrea Righi --- diff --git a/kconfig/run.py b/kconfig/run.py index 440dcda..fc7485e 100644 --- a/kconfig/run.py +++ b/kconfig/run.py @@ -268,13 +268,20 @@ def do_check(args): policy = a.config[conf] if conf in a.config else "undefined" if "policy" in policy: policy = f"policy<{policy['policy']}>" - print(f"check-config: FAIL: ({value} != {expected}): {conf} {policy})") + print(f"check-config: {conf} changed from {expected} to {value}: {policy})") ret = 1 else: good += 1 total += 1 - print(f"check-config: {good}/{total} checks passed -- exit {ret}") + num = total - good + if ret: + if os.path.exists('.git'): + print(f"check-config: {num} config options have been changed, review them with `git diff`") + else: + print(f"check-config: {num} config options have changed") + else: + print("check-config: all good") sys.exit(ret)