Skip to content

Commit 3e23618

Browse files
committed
Treat replaces field as list
It's specified to be a list, but every file in the main branch treats it as simple string. Signed-off-by: Matthias Büchse <[email protected]>
1 parent 695241a commit 3e23618

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Tests/chk_adrs.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,13 @@ def check_front_matter(self, fn, front, filenames):
136136
replaces = front.get("replaces")
137137
if replaces is None:
138138
self.emit(f"in {fn}: missing replaces field")
139-
elif replaces not in filenames:
140-
self.emit(f"in {fn}: original version {replaces} not found")
139+
else:
140+
if isinstance(replaces, str):
141+
print(f"WARNING: replaces field not a list in {fn}", file=sys.stderr)
142+
replaces = [replaces]
143+
missing = [fn for fn in replaces if fn not in filenames]
144+
if missing:
145+
self.emit(f"in {fn}: original version(s) {','.join(missing)} not found")
141146
# now do cross-field checks
142147
status = front.get("status")
143148
if "replaced_by" in front and status not in ("Deprecated", "Rejected"):

0 commit comments

Comments
 (0)