Skip to content

Commit 3d7ae4b

Browse files
(#14911) yamllinter: raise if a version has patches but no sources
* yamllinter: raise if a version has patches but no sources * Update conandata_yaml_linter.py * we dont want to make noise se from errors just yet --------- Co-authored-by: Chris Mc <[email protected]>
1 parent d7c11ed commit 3d7ae4b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

linter/conandata_yaml_linter.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ def main():
6262
if "patches" in parsed:
6363
for version in parsed["patches"]:
6464
patches = parsed["patches"][version]
65+
if version not in parsed["sources"]:
66+
print(
67+
f"::warning file={args.path},line={patches.start_line},endline={patches.end_line},"
68+
f"title=conandata.yml inconsistency"
69+
f"::Patch(es) are listed for version `{version}`, but there is source for this version."
70+
f" You should either remove `{version}` from the `patches` section, or add it to the"
71+
f" `sources` section"
72+
)
6573
for i, patch in enumerate(patches):
6674
# Individual report errors for each patch object
6775
try:

0 commit comments

Comments
 (0)