Skip to content

Commit

Permalink
remove lint & test for now
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Aug 9, 2024
1 parent 601e1a1 commit f1b2ef2
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 217 deletions.
4 changes: 3 additions & 1 deletion conda_smithy/linter/conda_recipe_v2_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def lint_recipe_tests(
else:
no_test_hints.append(
"It looks like the '{}' output doesn't "
"have any tests.".format(section.get("name", "???"))
"have any tests.".format(
section.get("name", "???")
)
)
if has_outputs_test:
hints.extend(no_test_hints)
Expand Down
16 changes: 1 addition & 15 deletions conda_smithy/linter/lints.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def lint_build_section_should_be_before_run(requirements_section, lints):


def lint_sources_should_have_hash(
sources_section: list[dict[str, Any]], lints, recipe_version: int = 1
sources_section: list[dict[str, Any]], lints: list[str]
):
for source_section in sources_section:
if "url" in source_section and not (
Expand All @@ -209,20 +209,6 @@ def lint_sources_should_have_hash(
"or md5 checksum (sha256 preferably)."
)

if recipe_version == 2:
# make sure there is no templating involved for the hash and they look alright
for source in sources_section:
if source.get("sha256"):
if not re.match(r"[0-9a-f]{64}", source["sha256"]):
lints.append(
"sha256 checksum must be 64 characters long. Templates are not allowed in the sha256 checksum."
)
if source.get("md5"):
if not re.match(r"[0-9a-f]{32}", source["md5"]):
lints.append(
"md5 checksum must be 32 characters long. Templates are not allowed in the md5 checksum."
)


def lint_license_should_not_have_license(about_section, lints):
license = about_section.get("license", "").lower()
Expand Down
35 changes: 0 additions & 35 deletions tests/recipes/rattler_recipes/boltons_arch/recipe.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions tests/recipes/rattler_recipes/boltons_arch/variants.yaml

This file was deleted.

37 changes: 0 additions & 37 deletions tests/recipes/rattler_recipes/build_script_with_findings/build.sh

This file was deleted.

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions tests/recipes/source_section_v2/recipe-lint-name-version.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions tests/recipes/source_section_v2/recipe-no-lint.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions tests/recipes/source_section_v2/recipe-sha-template.yaml

This file was deleted.

19 changes: 5 additions & 14 deletions tests/test_lint_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2675,33 +2675,24 @@ def test_pin_compatible_in_run_exports_output(recipe_version: int):
assert any(lint.startswith(expected) for lint in lints)


def test_source_section_v2():
def test_v1_recipes():
with get_recipe_in_dir(
"source_section_v2/recipe-no-lint.yaml"
"v1_recipes/recipe-no-lint.yaml"
) as recipe_dir:
lints, hints = linter.main(str(recipe_dir), return_hints=True)
assert not lints


def test_source_section_v2_template():
def test_v1_package_name_version():
with get_recipe_in_dir(
"source_section_v2/recipe-sha-template.yaml"
) as recipe_dir:
lints, hints = linter.main(str(recipe_dir), return_hints=True)
assert any(
"sha256 checksum must be 64 characters long. Templates are not allowed in the sha256 checksum." in lint
for lint in lints
)

def test_v2_package_name_version():
with get_recipe_in_dir(
"source_section_v2/recipe-lint-name-version.yaml"
"v1_recipes/recipe-lint-name-version.yaml"
) as recipe_dir:
lints, hints = linter.main(str(recipe_dir), return_hints=True)
lint_1 = "Recipe name has invalid characters. only lowercase alpha, numeric, underscores, hyphens and dots allowed"
lint_2 = "Package version $!@# doesn't match conda spec: Invalid version '$!@#': invalid character(s)"
assert lint_1 in lints
assert lint_2 in lints


if __name__ == "__main__":
unittest.main()

0 comments on commit f1b2ef2

Please sign in to comment.