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

Fix shed linting to respect --fail_fast. #547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
12 changes: 9 additions & 3 deletions planemo/shed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,9 +1293,14 @@ def _shed_config_excludes(config):
return config.get('ignore', []) + config.get('exclude', [])


def fail_fast(**kwds):
"""Should shed operation problems halt future ops."""
fail_fast_val = kwds.get("fail_fast", False)
return fail_fast_val


def _handle_realization_error(exception, **kwds):
fail_fast = kwds.get("fail_fast", False)
if fail_fast:
if fail_fast(kwds):
raise exception
else:
error(str(exception))
Expand Down Expand Up @@ -1354,8 +1359,9 @@ class RealizationException(Exception):
"""

__all__ = [
'for_each_repository',
'api_exception_to_message',
'fail_fast',
'for_each_repository',
'tool_shed_client', # Deprecated...
'get_shed_context',
'tool_shed_url',
Expand Down
6 changes: 5 additions & 1 deletion planemo/shed_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
REPO_TYPE_TOOL_DEP,
REPO_TYPE_SUITE,
CURRENT_CATEGORIES,
fail_fast,
validate_repo_owner,
validate_repo_name,
)
Expand Down Expand Up @@ -121,7 +122,10 @@ def lint_repository(ctx, realized_repository, **kwds):
if not failed:
failed = lint_ctx.failed(lint_args["fail_level"])
if failed:
error("Failed linting")
if fail_fast(**kwds):
raise Exception("Failed to lint repository.")
else:
error("Failed linting")
return 1 if failed else 0


Expand Down