Skip to content

Commit 2f35e68

Browse files
committed
Revert "scripts: ci: check_compliance: Add support for module Kconfigs"
This reverts commit 6013fc7. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
1 parent 9219c81 commit 2f35e68

File tree

1 file changed

+6
-56
lines changed

1 file changed

+6
-56
lines changed

scripts/ci/check_compliance.py

Lines changed: 6 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -723,58 +723,6 @@ def parse_kconfig(self):
723723
# Clean up the temporary directory
724724
shutil.rmtree(kconfiglib_dir)
725725

726-
def module_kconfigs(self, regex):
727-
manifest = Manifest.from_file()
728-
kconfigs = ""
729-
730-
for project in manifest.get_projects([]):
731-
if not manifest.is_active(project):
732-
continue
733-
734-
if not project.is_cloned():
735-
continue
736-
737-
module_path = PurePath(project.abspath)
738-
module_yml = module_path.joinpath('zephyr/module.yml')
739-
740-
if not Path(module_yml).is_file():
741-
module_yml = module_path.joinpath('zephyr/module.yaml')
742-
743-
if Path(module_yml).is_file():
744-
dirs = []
745-
746-
with Path(module_yml).open('r', encoding='utf-8') as f:
747-
meta = yaml.load(f.read(), Loader=SafeLoader)
748-
749-
for folder_type in ['samples', 'tests']:
750-
if folder_type in meta:
751-
for path_ext in meta[folder_type]:
752-
path_full = module_path.joinpath(path_ext)
753-
754-
if Path(path_full).is_dir():
755-
dirs.append(":" + path_ext)
756-
757-
# Add ext. module root, if one is defined. For zephyr, the base one is added
758-
# directly since in CMake it is added statically instead of by parsing the
759-
# zephyr module file
760-
if module_path == ZEPHYR_BASE:
761-
dirs.append(":" + str(module_path / "modules"))
762-
elif 'build' in meta and 'settings' in meta['build'] and \
763-
'module_ext_root' in meta['build']['settings']:
764-
path_full = module_path.joinpath(meta['build']['settings']['module_ext_root'])
765-
766-
if Path(path_full).is_dir():
767-
dirs.append(":" + meta['build']['settings']['module_ext_root'])
768-
769-
if len(dirs) > 0:
770-
tmp_output = git("grep", "-I", "-h", "--perl-regexp", regex, "--",
771-
*dirs, cwd=module_path, ignore_non_zero=True)
772-
773-
if len(tmp_output) > 0:
774-
kconfigs += tmp_output + "\n"
775-
776-
return kconfigs
777-
778726
def get_logging_syms(self, kconf):
779727
# Returns a set() with the names of the Kconfig symbols generated with
780728
# logging template in samples/tests folders. The Kconfig symbols doesn't
@@ -795,8 +743,9 @@ def get_logging_syms(self, kconf):
795743
# Warning: Needs to work with both --perl-regexp and the 're' module.
796744
regex = r"^\s*(?:module\s*=\s*)([A-Z0-9_]+)\s*(?:#|$)"
797745

798-
# Grep samples/ and tests/ for symbol definitions in all modules
799-
grep_stdout = self.module_kconfigs(regex)
746+
# Grep samples/ and tests/ for symbol definitions
747+
grep_stdout = git("grep", "-I", "-h", "--perl-regexp", regex, "--",
748+
":samples", ":tests", cwd=ZEPHYR_BASE)
800749

801750
names = re.findall(regex, grep_stdout, re.MULTILINE)
802751

@@ -949,8 +898,9 @@ def get_defined_syms(self, kconf):
949898
# (?:...) is a non-capturing group.
950899
regex = r"^\s*(?:menu)?config\s*([A-Z0-9_]+)\s*(?:#|$)"
951900

952-
# Grep samples/ and tests/ for symbol definitions in all modules
953-
grep_stdout = self.module_kconfigs(regex)
901+
# Grep samples/ and tests/ for symbol definitions
902+
grep_stdout = git("grep", "-I", "-h", "--perl-regexp", regex, "--",
903+
":samples", ":tests", cwd=ZEPHYR_BASE)
954904

955905
# Generate combined list of configs and choices from the main Kconfig tree.
956906
kconf_syms = kconf.unique_defined_syms + kconf.unique_choices

0 commit comments

Comments
 (0)