From 5972b4cf5c94314bd95261a77ec01126f9a1610a Mon Sep 17 00:00:00 2001 From: Andrea Righi Date: Fri, 7 Jul 2023 10:29:59 +0200 Subject: [PATCH] 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 --- kconfig/run.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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) -- 2.31.1