diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a8e56b87fb809325066f54f34a6527c7838a8f34..80400482778ca330d3b3430db68acc6d293d2741 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -73,5 +73,5 @@ jobs: python-version: "3.x" - name: Run pylint run: | - pip install pylint==2.8.2 + pip install pylint==2.10.2 pylint plugins --disable=import-error diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c4705358fb76056744fb6b9f087e399b6f3412ff..9ad47baae8a4b981a98154b2074e13c93c9479ef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: hooks: - id: pydocstyle - repo: https://github.com/pycqa/pylint - rev: v2.9.5 + rev: v2.10.2 hooks: - id: pylint args: diff --git a/plugins/module_utils/ansible_freeipa_module.py b/plugins/module_utils/ansible_freeipa_module.py index 4b3884a9af1211df3839232d312c42952907744a..e8d62e2800d5a57a973c16560ae5195b36be991e 100644 --- a/plugins/module_utils/ansible_freeipa_module.py +++ b/plugins/module_utils/ansible_freeipa_module.py @@ -104,7 +104,7 @@ else: try: from collections.abc import Mapping # noqa except ImportError: - from collections import Mapping # noqa + from collections import Mapping # pylint: disable=deprecated-class if six.PY3: unicode = str diff --git a/plugins/modules/ipaautomountlocation.py b/plugins/modules/ipaautomountlocation.py index c88578b259592f464d9930e39635c54932780269..44748c0ed5ae1051fb2ebd5aff3e24df33b522c4 100644 --- a/plugins/modules/ipaautomountlocation.py +++ b/plugins/modules/ipaautomountlocation.py @@ -78,15 +78,14 @@ class AutomountLocation(FreeIPABaseModule): ipa_param_mapping = {} def get_location(self, location): - response = dict() try: response = self.api_command("automountlocation_show", location, {}) except ipalib_errors.NotFound: - pass - - return response.get("result", None) + return None + else: + return response.get("result", None) def check_ipa_params(self): if len(self.ipa_params.name) == 0: diff --git a/requirements-dev.txt b/requirements-dev.txt index 4384655f68819922ee1e97aed66073050ef0b7d4..b1e4d0a7452c8b18dee291c5607f58e24ba65b1b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,3 +2,4 @@ ipdb pre-commit flake8-bugbear +pylint==2.10.2 diff --git a/setup.cfg b/setup.cfg index a470e2f9fa798d73049bec4404ea6469acfeb224..f446224183f5f1b98233ddb1d02d69ef5e9fbbdc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,6 +34,9 @@ ignore = D1,D212,D203 [pylint.MASTER] disable = + unspecified-encoding, # open() does not provide `encoding` in Python2 + use-maxsplit-arg, + redundant-u-string-prefix, c-extension-no-member, missing-module-docstring, missing-class-docstring,