Merge pull request #471 from rjeffman/tools_flake8_bugbear

Tools flake8 bugbear
This commit is contained in:
Thomas Woerner
2020-12-22 15:29:07 +01:00
committed by GitHub
4 changed files with 6 additions and 6 deletions

View File

@@ -30,4 +30,4 @@ jobs:
uses: ibiqlik/action-yamllint@v1 uses: ibiqlik/action-yamllint@v1
- name: Run Python linters - name: Run Python linters
uses: rjeffman/python-lint-action@master uses: rjeffman/python-lint-action@v2

View File

@@ -1375,8 +1375,7 @@ def define_commands_for_present_state(module, zone_name, entry, res_find):
# remove record from args, as it will not be used again. # remove record from args, as it will not be used again.
del args[record] del args[record]
else: else:
for f in part_fields: _args = {k: args[k] for k in part_fields if k in args}
_args = {k: args[k] for k in part_fields}
_args['idnsname'] = name _args['idnsname'] = name
_commands.append([zone_name, 'dnsrecord_add', _args]) _commands.append([zone_name, 'dnsrecord_add', _args])
# clean used fields from args # clean used fields from args

View File

@@ -1,3 +1,4 @@
-r requirements-tests.txt -r requirements-tests.txt
ipdb ipdb
pre-commit pre-commit
flake8-bugbear

View File

@@ -169,7 +169,7 @@ def list_test_yaml(dir_path):
`test_` and the extension is `.yml`. `test_` and the extension is `.yml`.
""" """
yamls = [] yamls = []
for root, dirs, files in os.walk(dir_path): for root, _dirs, files in os.walk(dir_path):
for yaml_name in files: for yaml_name in files:
if yaml_name.startswith("test_") and yaml_name.endswith(".yml"): if yaml_name.startswith("test_") and yaml_name.endswith(".yml"):
test_yaml_path = os.path.join(root, yaml_name) test_yaml_path = os.path.join(root, yaml_name)