mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
pylint: Upgrade to version 2.10.2.
This PR sets pylint to version 2.10.2 in all linter actions, and fixes code in plugins so that this version new checks are either satisfied or ignored if needed.
This commit is contained in:
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -73,5 +73,5 @@ jobs:
|
|||||||
python-version: "3.x"
|
python-version: "3.x"
|
||||||
- name: Run pylint
|
- name: Run pylint
|
||||||
run: |
|
run: |
|
||||||
pip install pylint==2.8.2
|
pip install pylint==2.10.2
|
||||||
pylint plugins --disable=import-error
|
pylint plugins --disable=import-error
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: pydocstyle
|
- id: pydocstyle
|
||||||
- repo: https://github.com/pycqa/pylint
|
- repo: https://github.com/pycqa/pylint
|
||||||
rev: v2.9.5
|
rev: v2.10.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: pylint
|
- id: pylint
|
||||||
args:
|
args:
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ else:
|
|||||||
try:
|
try:
|
||||||
from collections.abc import Mapping # noqa
|
from collections.abc import Mapping # noqa
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from collections import Mapping # noqa
|
from collections import Mapping # pylint: disable=deprecated-class
|
||||||
|
|
||||||
if six.PY3:
|
if six.PY3:
|
||||||
unicode = str
|
unicode = str
|
||||||
|
|||||||
@@ -78,15 +78,14 @@ class AutomountLocation(FreeIPABaseModule):
|
|||||||
ipa_param_mapping = {}
|
ipa_param_mapping = {}
|
||||||
|
|
||||||
def get_location(self, location):
|
def get_location(self, location):
|
||||||
response = dict()
|
|
||||||
try:
|
try:
|
||||||
response = self.api_command("automountlocation_show",
|
response = self.api_command("automountlocation_show",
|
||||||
location,
|
location,
|
||||||
{})
|
{})
|
||||||
except ipalib_errors.NotFound:
|
except ipalib_errors.NotFound:
|
||||||
pass
|
return None
|
||||||
|
else:
|
||||||
return response.get("result", None)
|
return response.get("result", None)
|
||||||
|
|
||||||
def check_ipa_params(self):
|
def check_ipa_params(self):
|
||||||
if len(self.ipa_params.name) == 0:
|
if len(self.ipa_params.name) == 0:
|
||||||
|
|||||||
@@ -2,3 +2,4 @@
|
|||||||
ipdb
|
ipdb
|
||||||
pre-commit
|
pre-commit
|
||||||
flake8-bugbear
|
flake8-bugbear
|
||||||
|
pylint==2.10.2
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ ignore = D1,D212,D203
|
|||||||
|
|
||||||
[pylint.MASTER]
|
[pylint.MASTER]
|
||||||
disable =
|
disable =
|
||||||
|
unspecified-encoding, # open() does not provide `encoding` in Python2
|
||||||
|
use-maxsplit-arg,
|
||||||
|
redundant-u-string-prefix,
|
||||||
c-extension-no-member,
|
c-extension-no-member,
|
||||||
missing-module-docstring,
|
missing-module-docstring,
|
||||||
missing-class-docstring,
|
missing-class-docstring,
|
||||||
|
|||||||
Reference in New Issue
Block a user