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:
parent
407041a10f
commit
5d23505336
1 changed files with 5 additions and 3 deletions
|
@ -57,7 +57,9 @@ def get_shas(refspec):
|
||||||
def get_files(filter=None, paths=None):
|
def get_files(filter=None, paths=None):
|
||||||
filter_arg = (f'--diff-filter={filter}',) if filter else ()
|
filter_arg = (f'--diff-filter={filter}',) if filter else ()
|
||||||
paths_arg = ('--', *paths) if paths 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):
|
class FmtdFailure(Failure):
|
||||||
|
|
||||||
|
@ -688,7 +690,7 @@ class Nits(ComplianceTest):
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# Loop through added/modified files
|
# Loop through added/modified files
|
||||||
for fname in get_files(filter="d").splitlines():
|
for fname in get_files(filter="d"):
|
||||||
if "Kconfig" in fname:
|
if "Kconfig" in fname:
|
||||||
self.check_kconfig_header(fname)
|
self.check_kconfig_header(fname)
|
||||||
self.check_redundant_zephyr_source(fname)
|
self.check_redundant_zephyr_source(fname)
|
||||||
|
@ -810,7 +812,7 @@ class PyLint(ComplianceTest):
|
||||||
"pylintrc"))
|
"pylintrc"))
|
||||||
|
|
||||||
# List of files added/modified by the commit(s).
|
# 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
|
# Filter out everything but Python files. Keep filenames
|
||||||
# relative (to GIT_TOP) to stay farther from any command line
|
# relative (to GIT_TOP) to stay farther from any command line
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue