Commit 4f84bc8f authored by Kumar Gala's avatar Kumar Gala Committed by Carles Cufi
Browse files

scripts/ci/check_compliance.py: Allow to run w/ZEPHYR_BASE



Tweak check_compliance.py to allow user to run it w/o having
ZEPHYR_BASE set.  This is similar to what we do for twister.

Signed-off-by: default avatarKumar Gala <galak@kernel.org>
parent 3dccd319
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -27,6 +27,15 @@ logger = None

# This ends up as None when we're not running in a Zephyr tree
ZEPHYR_BASE = os.environ.get('ZEPHYR_BASE')
if not ZEPHYR_BASE:
    # Let the user run this script as ./scripts/ci/check_compliance.py without
    #  making them set ZEPHYR_BASE.
    ZEPHYR_BASE = str(Path(__file__).resolve().parents[2])

    # Propagate this decision to child processes.
    os.environ['ZEPHYR_BASE'] = ZEPHYR_BASE

    print(f'ZEPHYR_BASE unset, using "{ZEPHYR_BASE}"')


def git(*args, cwd=None):