Автоматическая проверка кода с помощью pylint
Файл .pylintrc:
[MESSAGES CONTROL]
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=C0111,F0401,C0301,R0903,W0232,E1101,C0103,R0913,W0141,R0201,C0330,singleton-comparison
Осваиваем навыки работы с pylint
-
Установите и запустите pylint с настройками по умолчанию в вашей IDE.
-
Проверьте следующий код с помощью pylint:
'''test module'''
def func(arg1):
'''simple function'''
if len(arg1) > 10:
return arg1
- Выберите правильный вариант ответа:
Проверка