Skip to content

Commit

Permalink
CI: Add new lint for multi-output recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
carterbox committed Nov 25, 2024
1 parent ec10885 commit 0e0b2fc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/scripts/linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ def _lint_recipes(gh, pr):
sources_section = get_section(
meta, "source", lints, recipe_version=recipe_version
)
outputs_section = get_section(
meta, "outputs", lints, recipe_version=recipe_version
)
extra_section = get_section(
meta, "extra", lints, recipe_version=recipe_version
)
Expand All @@ -101,6 +104,8 @@ def _lint_recipes(gh, pr):
else:
recipe_name = package_section.get("name", "").strip()

recipe_name = extra_section.get("feedstock-name", recipe_name)

# 4. Check for existing feedstocks in conda-forge or bioconda
if recipe_name:
cf = gh.get_user("conda-forge")
Expand Down Expand Up @@ -214,6 +219,15 @@ def _lint_recipes(gh, pr):
'correct format. Please use "org/team" format.'
)

# 7. Check that feedstock-name is defined if recipe is multi-output
if outputs_section and ("feedstock-name" not in extra_section):
hints[fname].append(
"It looks like you are submitting a multi-output recipe. "
"In these cases, the correct name for the feedstock is ambiguous, "
"and our infrastructure defaults to the top-level `package.name` field. "
"Please add a `feedstock-name` entry in the `extra` section."
)

return dict(lints), dict(hints), extra_edits


Expand Down

0 comments on commit 0e0b2fc

Please sign in to comment.