Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#### Other
* Fix small typo in central readme of tools for future releases
* Switched to yaml.safe_load() to fix PyYAML warning that was thrown because of a possible [exploit](https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation)

## v1.6

Expand Down
2 changes: 1 addition & 1 deletion nf_core/licences.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def fetch_conda_licences(self):
raise LookupError("Couldn't find pipeline nf-core/{}".format(self.pipeline))

lint_obj = nf_core.lint.PipelineLint(self.pipeline)
lint_obj.conda_config = yaml.load(response.text)
lint_obj.conda_config = yaml.safe_load(response.text)
# Check conda dependency list
for dep in lint_obj.conda_config.get('dependencies', []):
try:
Expand Down
4 changes: 2 additions & 2 deletions nf_core/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def pf(file_path):
# Load and parse files for later
if 'environment.yml' in self.files:
with open(os.path.join(self.path, 'environment.yml'), 'r') as fh:
self.conda_config = yaml.load(fh)
self.conda_config = yaml.safe_load(fh)

def check_docker(self):
"""Checks that Dockerfile contains the string ``FROM``."""
Expand Down Expand Up @@ -446,7 +446,7 @@ def check_ci_config(self):
fn = os.path.join(self.path, cf)
if os.path.isfile(fn):
with open(fn, 'r') as fh:
ciconf = yaml.load(fh)
ciconf = yaml.safe_load(fh)
# Check that we have the master branch protection
travisMasterCheck = '[ $TRAVIS_PULL_REQUEST = "false" ] || [ $TRAVIS_BRANCH != "master" ] || ([ $TRAVIS_PULL_REQUEST_SLUG = $TRAVIS_REPO_SLUG ] && [ $TRAVIS_PULL_REQUEST_BRANCH = "dev" ])'
try:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def test_conda_env_pass(self):
lint_obj = nf_core.lint.PipelineLint(PATH_WORKING_EXAMPLE)
lint_obj.files = ['environment.yml']
with open(os.path.join(PATH_WORKING_EXAMPLE, 'environment.yml'), 'r') as fh:
lint_obj.conda_config = yaml.load(fh)
lint_obj.conda_config = yaml.safe_load(fh)
lint_obj.pipeline_name = 'tools'
lint_obj.config['manifest.version'] = '0.4'
lint_obj.check_conda_env_yaml()
Expand All @@ -272,7 +272,7 @@ def test_conda_env_fail(self):
lint_obj = nf_core.lint.PipelineLint(PATH_WORKING_EXAMPLE)
lint_obj.files = ['environment.yml']
with open(os.path.join(PATH_WORKING_EXAMPLE, 'environment.yml'), 'r') as fh:
lint_obj.conda_config = yaml.load(fh)
lint_obj.conda_config = yaml.safe_load(fh)
lint_obj.conda_config['dependencies'] = ['fastqc', 'multiqc=0.9', 'notapackaage=0.4']
lint_obj.pipeline_name = 'not_tools'
lint_obj.config['manifest.version'] = '0.23'
Expand Down