Skip to content

Commit

Permalink
Bump pyyaml and specify explicit FullLoader for yaml
Browse files Browse the repository at this point in the history
Version for pyyaml has been restricted because it
has started to require an explicit loader for loading
yaml files. By appliying this commit, we can now remove
the restriction, since we explicitly specify the loader.
  • Loading branch information
Andrej Palička committed Dec 6, 2019
1 parent 91d6b2a commit c815961
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions .bellybutton.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
settings:
all_files: &all_files !settings
all_files: !settings &all_files
included:
- ~+/bellybutton/*
excluded:
- ~+/.tox/*
allow_ignore: yes

tests_only: &tests_only !settings
tests_only: !settings &tests_only
included:
- ~+/tests/*
excluded:
- ~+/.tox/*
allow_ignore: yes

excluding_tests: &excluding_tests !settings
excluding_tests: !settings &excluding_tests
included:
- ~+/bellybutton/*
excluded:
- ~+/tests/*
- ~+/.tox/*
allow_ignore: yes

excluding_cli: &excluding_cli !settings
excluding_cli: !settings &excluding_cli
<<: *excluding_tests
excluded:
- ~+/tests/*
- ~+/.tox/*
- ~+/bellybutton/cli.py

default_settings: *excluding_tests
default_settings: *all_files

rules:
IllicitPrint:
Expand All @@ -45,3 +45,6 @@ rules:
with open('x') as f:
pass
settings: *excluding_cli
MissingPytestMarkAsyncio:
description: "Missing decorator @pytest.mark.asyncio in asynchronous test"
expr: //AsyncFunctionDef[starts-with(@name, 'test_')]/decorator_list[not(Attribute[@attr = 'asyncio']/value/Attribute[@attr = 'mark']/value/Name[@id = 'pytest'])]
2 changes: 1 addition & 1 deletion bellybutton/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def parse_rule(rule_name, rule_values, default_settings=None):

def load_config(fileobj):
"""Load bellybutton config file, returning a list of rules."""
loaded = yaml.load(fileobj)
loaded = yaml.load(fileobj, Loader = yaml.FullLoader)
default_settings = loaded.get('default_settings')
rules = [
parse_rule(rule_name, rule_values, default_settings)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
license='MIT',
install_requires=[
'astpath[xpath]==0.6.1',
'pyyaml>=3.12,<4.0',
'pyyaml>=4.0,<6.0',
'lxml>=4.1.1',
],
tests_require=['pytest>=3.1.2', 'future>=0.16.0'],
Expand Down

0 comments on commit c815961

Please sign in to comment.