summaryrefslogtreecommitdiff
path: root/tools/buildman/boards.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-19 17:48:19 -0600
committerSimon Glass <sjg@chromium.org>2023-07-24 09:34:10 -0600
commitbc12d03493d7aa1bdda6d9dc40e2457fb8e33684 (patch)
tree9db3faf8c36534c301a0e7c954902e055815cee6 /tools/buildman/boards.py
parenta114c6153699d0a9f3730d630a04a3c6c648a775 (diff)
buildman: Warn about dangling maintainer entries
Other than the top-level MAINTAINERS file, all maintainer entries should actually reference a target. Add a warning to detect those that do not. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman/boards.py')
-rw-r--r--tools/buildman/boards.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py
index df57f278daa..122fe7090bf 100644
--- a/tools/buildman/boards.py
+++ b/tools/buildman/boards.py
@@ -345,17 +345,28 @@ class MaintainersDatabase:
srcdir (str): Directory containing source code (Kconfig files)
fname (str): MAINTAINERS file to be parsed
"""
- def add_targets():
- """Add any new targets"""
+ def add_targets(linenum):
+ """Add any new targets
+
+ Args:
+ linenum (int): Current line number
+ """
+ added = False
if targets:
for target in targets:
self.database[target] = (status, maintainers)
+ added = True
+ if not added and (status != '-' and maintainers):
+ leaf = fname[len(srcdir) + 1:]
+ if leaf != 'MAINTAINERS':
+ self.warnings.append(
+ f'WARNING: orphaned defconfig in {leaf} ending at line {linenum + 1}')
targets = []
maintainers = []
status = '-'
with open(fname, encoding="utf-8") as inf:
- for line in inf:
+ for linenum, line in enumerate(inf):
# Check also commented maintainers
if line[:3] == '#M:':
line = line[1:]
@@ -388,11 +399,11 @@ class MaintainersDatabase:
if match and not rear:
targets.append(front)
elif line == '\n':
- add_targets()
+ add_targets(linenum)
targets = []
maintainers = []
status = '-'
- add_targets()
+ add_targets(linenum)
class Boards: