(#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 <prince.chrismc@gmail.com>
This commit is contained in:
ericLemanissier
2023-02-10 10:06:03 +01:00
committed by GitHub
parent d7c11eda06
commit 3d7ae4bb5d

View File

@@ -62,6 +62,14 @@ def main():
if "patches" in parsed:
for version in parsed["patches"]:
patches = parsed["patches"][version]
if version not in parsed["sources"]:
print(
f"::warning file={args.path},line={patches.start_line},endline={patches.end_line},"
f"title=conandata.yml inconsistency"
f"::Patch(es) are listed for version `{version}`, but there is source for this version."
f" You should either remove `{version}` from the `patches` section, or add it to the"
f" `sources` section"
)
for i, patch in enumerate(patches):
# Individual report errors for each patch object
try: