Skip to content

Commit

Permalink
Make yaml loading more compact
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoesters committed Jan 10, 2023
1 parent b87ad38 commit ceb5c6d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions anaconda_linter/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,11 @@ def validate_config(config):
directly.
"""
if not isinstance(config, dict):
with open(config) as c:
conf = c.read()
config = yaml.load(conf)
with open(config) as conf:
config = yaml.load(conf.read())
fn = os.path.abspath(os.path.dirname(__file__)) + "/config.schema.yaml"
with open(fn) as f:
schema_str = f.read()
schema = yaml.load(schema_str)
schema = yaml.load(f.read())
validate(config, schema)


Expand Down

0 comments on commit ceb5c6d

Please sign in to comment.