Skip to content

Commit

Permalink
Merge pull request #822 from KevinMenden/yaml-load-exception
Browse files Browse the repository at this point in the history
linting: better error message to yaml loading
  • Loading branch information
KevinMenden authored Jan 18, 2021
2 parents ef3f73a + 5c31748 commit e529029
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions nf_core/lint/actions_awsfulltest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def actions_awsfulltest(self):
try:
with open(fn, "r") as fh:
wf = yaml.safe_load(fh)
except:
return {"failed": ["Could not parse yaml file: {}".format(fn)]}
except Exception as e:
return {"failed": ["Could not parse yaml file: {}, {}".format(fn, e)]}

aws_profile = "-profile test "

Expand Down
4 changes: 2 additions & 2 deletions nf_core/lint/actions_awstest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def actions_awstest(self):
try:
with open(fn, "r") as fh:
wf = yaml.safe_load(fh)
except:
return {"failed": ["Could not parse yaml file: {}".format(fn)]}
except Exception as e:
return {"failed": ["Could not parse yaml file: {}, {}".format(fn, e)]}

# Check that the action is only turned on for workflow_dispatch
try:
Expand Down
4 changes: 2 additions & 2 deletions nf_core/lint/actions_branch_protection.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def actions_branch_protection(self):
try:
with open(fn, "r") as fh:
branchwf = yaml.safe_load(fh)
except:
return {"failed": ["Could not parse yaml file: {}".format(fn)]}
except Exception as e:
return {"failed": ["Could not parse yaml file: {}, {}".format(fn, e)]}

# Check that the action is turned on for PRs to master
try:
Expand Down
4 changes: 2 additions & 2 deletions nf_core/lint/actions_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def actions_ci(self):
try:
with open(fn, "r") as fh:
ciwf = yaml.safe_load(fh)
except:
return {"failed": ["Could not parse yaml file: {}".format(fn)]}
except Exception as e:
return {"failed": ["Could not parse yaml file: {}, {}".format(fn, e)]}

# Check that the action is turned on for the correct events
try:
Expand Down
4 changes: 2 additions & 2 deletions nf_core/lint/actions_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def actions_lint(self):
try:
with open(fn, "r") as fh:
lintwf = yaml.safe_load(fh)
except:
return {"failed": ["Could not parse yaml file: {}".format(fn)]}
except Exception as e:
return {"failed": ["Could not parse yaml file: {}, {}".format(fn, e)]}

# Check that the action is turned on for push and pull requests
try:
Expand Down

0 comments on commit e529029

Please sign in to comment.