Я использую pytlint 2.5
, чтобы проверить стандарты кода приложения Pythong (3.7). Ниже один из моих классов, который вызывает ошибку pylint
.
class MyClass(FlaskJSONEncoder):
def default(self, o):
return FlaskJSONEncoder.default(self, o)
Ошибка, которую я получил:
File "/usr/bin/pylint", line 8, in <module>
sys.exit(run_pylint())
File "/usr/lib/python3.7/site-packages/pylint/__init__.py", line 22, in run_pylint
PylintRun(sys.argv[1:])
File "/usr/lib/python3.7/site-packages/pylint/lint/run.py", line 338, in __init__
linter.check(args)
File "/usr/lib/python3.7/site-packages/pylint/lint/pylinter.py", line 871, in check
self.get_ast, self._iterate_file_descrs(files_or_modules)
File "/usr/lib/python3.7/site-packages/pylint/lint/pylinter.py", line 904, in _check_files
self._check_file(get_ast, check_astroid_module, name, filepath, modname)
File "/usr/lib/python3.7/site-packages/pylint/lint/pylinter.py", line 930, in _check_file
check_astroid_module(ast_node)
File "/usr/lib/python3.7/site-packages/pylint/lint/pylinter.py", line 1063, in check_astroid_module
ast_node, walker, rawcheckers, tokencheckers
File "/usr/lib/python3.7/site-packages/pylint/lint/pylinter.py", line 1107, in _check_astroid_module
walker.walk(ast_node)
File "/usr/lib/python3.7/site-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
File "/usr/lib/python3.7/site-packages/pylint/utils/ast_walker.py", line 75, in walk
self.walk(child)
File "/usr/lib/python3.7/site-packages/pylint/utils/ast_walker.py", line 72, in walk
callback(astroid)
File "/usr/lib/python3.7/site-packages/pylint/checkers/classes.py", line 996, in visit_functiondef
for subklass in mro[1 : mro.index(overridden_frame) + 1]:
ValueError: <ClassDef.JSONEncoder l.73 at 0x7fe7219b7a10> is not in list
Файл конфигурации Pylint:
[MASTER]
extension-pkg-whitelist=pymssql,rapidjson
[BASIC]
good-names=db,e,f,i,j
[MESSAGES CONTROL]
disable=
C0116, # missing-function-docstring
C0111, # missing-module-docstring
W0703, # broad-except
R0911, # too-many-return-statements
[DESIGN]
max-branches = 18
max-args = 10
max-locals = 29
max-statements = 100
max-line-length = 120
Я не знаю, почему Pylint генерирует исключение при проверке этого файла. Кто-нибудь знает эту ошибку? Это происходит на Пилинте-2.5, но не на Пилинте-2.4.4