Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Dec 7, 2023
1 parent b535eba commit 12e2d06
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ max-public-methods=20
max-returns=6

# Maximum number of statements in function / method body.
max-statements=50
max-statements=30

# Minimum number of public methods for a class (see R0903).
min-public-methods=2
Expand Down
3 changes: 2 additions & 1 deletion plugins/module_utils/base/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# could be implemented using inheritance in the future..

# pylint: disable=W0212,R0912
# NOTE: pylint is basically right, but I really do not want to take the time to refactor this..
# pylint: disable=W0212,R0912,R0915

from typing import Callable

Expand Down
3 changes: 2 additions & 1 deletion plugins/module_utils/helper/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def get_selected(data: dict) -> (str, None):

def get_selected_value(data: dict) -> (str, None):
if isinstance(data, dict):
for key, values in data.items():
for values in data.values():
if is_true(values['selected']) and 'value' in values:
return values['value']

Expand Down Expand Up @@ -360,6 +360,7 @@ def sort_param_lists(params: dict) -> None:
params[k].sort()


# pylint: disable=R0914,R0915
def simplify_translate(
existing: dict, translate: dict = None, typing: dict = None,
bool_invert: list = None, ignore: list = None, value_map: dict = None,
Expand Down
1 change: 1 addition & 0 deletions plugins/module_utils/main/alias_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.main.alias import Alias


# pylint: disable=R0915
def process(m: AnsibleModule, p: dict, r: dict, ) -> None:
session = Session(module=m)
meta_alias = Alias(module=m, session=session, result={})
Expand Down
1 change: 1 addition & 0 deletions plugins/module_utils/main/alias_purge.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.main.rule import Rule


# pylint: disable=R0915
def process(m: AnsibleModule, p: dict, r: dict) -> None:
s = Session(module=m)
meta_alias = Alias(module=m, session=s, result={})
Expand Down
1 change: 1 addition & 0 deletions plugins/module_utils/main/bind_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def __init__(
self.exists = False
self.exists_rr = False

# pylint: disable=R0915
def check(self) -> None:
if self.p['state'] == 'present':
if is_unset(self.p['value']):
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/main/ids_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def _search_call(self) -> dict:
**self.call_cnf, **{'command': self.CMDS['search']}
})[self.API_KEY_1][self.API_KEY]

# pylint: disable=W0212
simple = self.b._simplify_existing(settings)

try:
Expand Down Expand Up @@ -138,4 +139,3 @@ def _build_request(self) -> dict:
}

return {self.API_KEY_1: raw_request}

1 change: 1 addition & 0 deletions plugins/module_utils/main/rule_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.main.rule import Rule


# pylint: disable=R0915
def process(m: AnsibleModule, p: dict, r: dict) -> None:
s = Session(module=m)
meta_rule = Rule(module=m, session=s, result={})
Expand Down
1 change: 1 addition & 0 deletions plugins/module_utils/main/webproxy_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def _search_call(self) -> dict:
**self.call_cnf, **{'command': self.CMDS['search']}
})[self.API_KEY_1][self.API_KEY]

# pylint: disable=W0212
simple = self.b._simplify_existing(settings)

simple['log'] = is_true(
Expand Down
3 changes: 2 additions & 1 deletion plugins/modules/ids_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def run_module():
module_args = dict(
interfaces=dict(
type='list', elements='str', required=True, aliases=['ints'],
description='Select interface(s) to use. When enabling IPS, only use physical interfaces here (no vlans etc)'
description='Select interface(s) to use. When enabling IPS, only use physical interfaces here '
'(no vlans etc)'
),
block=dict(
type='bool', required=False, default=False, aliases=['protection', 'ips'],
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
API_CONTROLLER = 'service'


# pylint: disable=R0915
def run_module():
service_choices = list(SERVICES.keys())
service_choices.sort()
Expand Down

0 comments on commit 12e2d06

Please sign in to comment.