Lines Matching +full:check +full:- +full:common +full:- +full:files

4 # SPDX-License-Identifier: Apache-2.0
7 Linter for the Zephyr Kconfig files. Pass --help to see
14 Requires west, because the checks need to see Kconfig files
47 for check in checks:
51 check()
55 # args.checks is set to a list of check functions to run
62 "-n", "--check-always-n",
71 "-u", "--check-unused",
78 - Isn't referenced in Kconfig
79 - Isn't referenced as CONFIG_<NAME> outside Kconfig
81 - Isn't selecting/implying other symbols
82 - Isn't a choice symbol
84 C preprocessor magic can trip up this check.""")
87 "-m", "--check-pointless-menuconfigs",
95 "-d", "--check-defconfig-only-definition",
99 files. A common base definition should probably be added
104 "-p", "--check-missing-config-prefix",
148 print_header("Symbols only defined in Kconfig.defconfig files")
158 modpaths = run(("west", "list", "-f{abspath}")).splitlines()
164 regex = r"#\s*define\s+([A-Z0-9_]+)\b"
165 defines = run(("git", "grep", "--extended-regexp", regex),
166 cwd=modpath, check=False)
167 # Could pass --only-matching to git grep as well, but it was added
184 cmd = ("git", "grep", "--line-number", "-I", "--perl-regexp", regex)
187 print(run(cmd, cwd=modpath, check=False), end="")
192 # equal-sized batches (possibly with a shorter batch at the end)
220 # the directory. Kconfig.modules brings in Kconfig files from modules.
224 "--kconfig-out", os.path.join(tmpdir, "Kconfig.modules")))
230 # Kconfig files (that we can detect), without any "CONFIG_" prefix
236 # Returns the names of all symbols referenced inside the Kconfig files
245 # Returns the names of all symbols referenced outside the Kconfig files
247 regex = r"\bCONFIG_[A-Z0-9_]+\b"
252 for modpath in run(("west", "list", "-f{abspath}")).splitlines():
253 for line in run(("git", "grep", "-h", "-I", "--extended-regexp", regex),
257 # files are not included
258 if re.match(r"[\s#]*CONFIG_[A-Z0-9_]+=.*", line):
261 # Could pass --only-matching to git grep as well, but it was added
293 def run(cmd, cwd=TOP_DIR, check=True): argument
295 # the working directory. It defaults to the top-level Zephyr directory.
296 # Exits with an error if the command exits with a non-zero return code if
297 # 'check' is True.
309 # https://github.com/zephyrproject-rtos/esp-idf/pull/2
310 stdout = stdout.decode("utf-8", errors="ignore")
311 stderr = stderr.decode("utf-8")
312 if check and process.returncode: