mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Improve python 2/3 ABC fallback for pylint. (#31848)
* Improve python 2/3 ABC fallback for pylint. * Allow longer method names in ansible-test.
This commit is contained in:
parent
70ae7382e5
commit
6c3339402a
2 changed files with 6 additions and 2 deletions
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
from __future__ import absolute_import, print_function
|
from __future__ import absolute_import, print_function
|
||||||
|
|
||||||
import abc
|
|
||||||
import errno
|
import errno
|
||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
|
@ -14,7 +13,11 @@ import re
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
ABC = abc.ABCMeta('ABC', (object,), {'__slots__': ()}) # compatible with Python 2 *and* 3
|
try:
|
||||||
|
from abc import ABC
|
||||||
|
except ImportError:
|
||||||
|
from abc import ABCMeta
|
||||||
|
ABC = ABCMeta('ABC', (), {})
|
||||||
|
|
||||||
|
|
||||||
def is_shippable():
|
def is_shippable():
|
||||||
|
|
|
@ -6,6 +6,7 @@ pylint --max-line-length=160 --reports=n ./*.py ./*/*.py ./*/*/*.py \
|
||||||
--jobs 2 \
|
--jobs 2 \
|
||||||
--rcfile /dev/null \
|
--rcfile /dev/null \
|
||||||
--function-rgx '[a-z_][a-z0-9_]{2,40}$' \
|
--function-rgx '[a-z_][a-z0-9_]{2,40}$' \
|
||||||
|
--method-rgx '[a-z_][a-z0-9_]{2,40}$' \
|
||||||
-d unused-import \
|
-d unused-import \
|
||||||
-d too-few-public-methods \
|
-d too-few-public-methods \
|
||||||
-d too-many-arguments \
|
-d too-many-arguments \
|
||||||
|
|
Loading…
Reference in a new issue