Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yamllinter: raise if a version has patches but no sources #14911

Merged
merged 4 commits into from
Feb 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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