scripts: compliance: fix DevicetreeBindingsCheck

DevicetreeBindingsCheck is missing the splitlines() call to process the
get_files() output, hence cycling through each character of the output
rather than each file, which causes the check to never run on anything.

Fix it by moving the splitline call into get_files() itself, since every
caller is going to use it anyway.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2022-12-22 11:42:08 +00:00 committed by Carles Cufí
commit 5d23505336

View file

@ -57,7 +57,9 @@ def get_shas(refspec):
def get_files(filter=None, paths=None):
filter_arg = (f'--diff-filter={filter}',) if filter else ()
paths_arg = ('--', *paths) if paths else ()
return git('diff', '--name-only', *filter_arg, COMMIT_RANGE, *paths_arg)
out = git('diff', '--name-only', *filter_arg, COMMIT_RANGE, *paths_arg)
files = out.splitlines()
return files
class FmtdFailure(Failure):
@ -688,7 +690,7 @@ class Nits(ComplianceTest):
def run(self):
# Loop through added/modified files
for fname in get_files(filter="d").splitlines():
for fname in get_files(filter="d"):
if "Kconfig" in fname:
self.check_kconfig_header(fname)
self.check_redundant_zephyr_source(fname)
@ -810,7 +812,7 @@ class PyLint(ComplianceTest):
"pylintrc"))
# List of files added/modified by the commit(s).
files = get_files(filter="d").splitlines()
files = get_files(filter="d")
# Filter out everything but Python files. Keep filenames
# relative (to GIT_TOP) to stay farther from any command line