-
Notifications
You must be signed in to change notification settings - Fork 86
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
raise report level for some shed linting #1111
base: master
Are you sure you want to change the base?
Changes from all commits
02a2411
bc43d59
4db71af
fb169b4
5c687a4
cee8cfb
c5602de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -290,14 +290,14 @@ def lint_repository_dependencies(realized_repository, lint_ctx): | |||
def lint_shed_yaml(realized_repository, lint_ctx): | ||||
path = realized_repository.real_path | ||||
shed_yaml = os.path.join(path, ".shed.yml") | ||||
if not os.path.exists(shed_yaml): | ||||
lint_ctx.info("No .shed.yml file found, skipping.") | ||||
if not os.path.exists(shed_yaml) and realized_repository.repository_type != REPO_TYPE_UNRESTRICTED: | ||||
lint_ctx.error("No .shed.yml file found, skipping.") | ||||
return | ||||
try: | ||||
with open(shed_yaml, "r") as fh: | ||||
yaml.safe_load(fh) | ||||
except Exception as e: | ||||
lint_ctx.warn("Failed to parse .shed.yml file [%s]" % unicodify(e)) | ||||
lint_ctx.error("Failed to parse .shed.yml file [%s]" % unicodify(e)) | ||||
return | ||||
lint_ctx.info(".shed.yml found and appears to be valid YAML.") | ||||
_lint_shed_contents(lint_ctx, realized_repository) | ||||
|
@@ -311,12 +311,17 @@ def _lint_if_present(key, func, *args): | |||
if value is not None: | ||||
msg = func(value, *args) | ||||
if msg: | ||||
lint_ctx.warn(msg) | ||||
lint_ctx.error(msg) | ||||
return value | ||||
|
||||
_lint_if_present("owner", validate_repo_owner) | ||||
_lint_if_present("name", validate_repo_name) | ||||
def _lint(key, func, *args): | ||||
if _lint_if_present(key, func, *args) is None: | ||||
lint_ctx.error("Repository does not define: %s" % key) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is going against the original intent of the method There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can rename the function? My aim it to error in cases where There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. I see .. the type does not need to be defined in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this also the case for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think planemo/planemo/shed/__init__.py Line 1022 in 157cace
name ..)
|
||||
|
||||
_lint("owner", validate_repo_owner) | ||||
_lint("name", validate_repo_name) | ||||
_lint_if_present("type", _validate_repo_type, config["name"]) | ||||
_lint_if_present("categories", _validate_categories, realized_repository) | ||||
_lint("categories", _validate_categories, realized_repository) | ||||
|
||||
|
||||
def _validate_repo_type(repo_type, name): | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: cat | ||
owner: iuc | ||
description: cat1 tool | ||
categories: | ||
- Text Manipulation |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
name: cat1 | ||
owner: iuc | ||
description: cat1 tool | ||
categories: | ||
- Text Manipulation |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
name: cat2 | ||
owner: iuc | ||
description: cat2 tool | ||
categories: | ||
- Text Manipulation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was an attempt to fix the testing error for https://github.com/galaxyproject/planemo/tree/master/tests/data/repos/suite_1 which fails because there is no
.shed.yml
.. which is OK in this case .. or isn't it?