Skip to content

Commit

Permalink
(conan-io#14911) yamllinter: raise if a version has patches but no so…
Browse files Browse the repository at this point in the history
…urces

* 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>
  • Loading branch information
2 people authored and sabelka committed Feb 12, 2023
1 parent 5472668 commit 7f380b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions linter/conandata_yaml_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7f380b9

Please sign in to comment.