Skip to content
This repository was archived by the owner on Apr 6, 2022. It is now read-only.

Commit 8a70a13

Browse files
ulfalizercarlescufi
authored andcommitted
check_compliance.py: Fix running Kconfig/pylint checks outside top dir
The PyLint and KconfigCheck tests are broken when not run from the top-level repository directory. Fix it by making the path to pylintrc absolute and explicitly running the 'git grep' for Kconfig definitions in samples/ and tests/ from the top-level Zephyr directory. The root cause was a mismatch between paths and process working directories. Signed-off-by: Ulf Magnusson <[email protected]>
1 parent c7d432c commit 8a70a13

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/check_compliance.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def get_defined_syms(kconf):
432432

433433
# Grep samples/ and tests/ for symbol definitions
434434
grep_stdout = git("grep", "-I", "-h", "--extended-regexp", regex, "--",
435-
":samples", ":tests")
435+
":samples", ":tests", cwd=ZEPHYR_BASE)
436436

437437
# Start with the symbols from the main Kconfig tree in 'res'
438438
res = set(sym.name for sym in kconf.unique_defined_syms)
@@ -802,7 +802,8 @@ class PyLint(ComplianceTest):
802802

803803
def run(self):
804804
# Path to pylint configuration file
805-
pylintrc = os.path.join(os.path.dirname(__file__), "pylintrc")
805+
pylintrc = os.path.abspath(os.path.join(os.path.dirname(__file__),
806+
"pylintrc"))
806807

807808
# List of files added/modified by the commit(s).
808809
files = git(

0 commit comments

Comments
 (0)