2019-03-08 18:49:30 +00:00
|
|
|
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
2021-04-11 13:29:34 +00:00
|
|
|
# For details: https://github.com/PyCQA/pylint/blob/master/LICENSE
|
2019-03-08 18:49:30 +00:00
|
|
|
|
2021-06-27 18:11:54 +00:00
|
|
|
import platform
|
2020-05-03 18:24:32 +00:00
|
|
|
import sys
|
|
|
|
|
2021-03-27 14:21:29 +00:00
|
|
|
import astroid
|
2020-05-03 18:24:32 +00:00
|
|
|
|
2021-04-04 12:37:19 +00:00
|
|
|
from pylint.__pkginfo__ import __version__
|
2019-03-10 21:10:12 +00:00
|
|
|
|
2021-01-23 13:13:33 +00:00
|
|
|
PY38_PLUS = sys.version_info[:2] >= (3, 8)
|
2021-03-25 21:26:01 +00:00
|
|
|
PY39_PLUS = sys.version_info[:2] >= (3, 9)
|
2021-01-23 13:13:33 +00:00
|
|
|
PY310_PLUS = sys.version_info[:2] >= (3, 10)
|
|
|
|
|
2021-06-27 18:11:54 +00:00
|
|
|
IS_PYPY = platform.python_implementation() == "PyPy"
|
2021-01-23 13:13:33 +00:00
|
|
|
|
2019-03-10 21:10:12 +00:00
|
|
|
PY_EXTS = (".py", ".pyc", ".pyo", ".pyw", ".so", ".dll")
|
|
|
|
|
2019-03-08 18:49:30 +00:00
|
|
|
MSG_STATE_CONFIDENCE = 2
|
|
|
|
_MSG_ORDER = "EWRCIF"
|
|
|
|
MSG_STATE_SCOPE_CONFIG = 0
|
|
|
|
MSG_STATE_SCOPE_MODULE = 1
|
|
|
|
|
|
|
|
# The line/node distinction does not apply to fatal errors and reports.
|
|
|
|
_SCOPE_EXEMPT = "FR"
|
|
|
|
|
|
|
|
MSG_TYPES = {
|
|
|
|
"I": "info",
|
|
|
|
"C": "convention",
|
|
|
|
"R": "refactor",
|
|
|
|
"W": "warning",
|
|
|
|
"E": "error",
|
|
|
|
"F": "fatal",
|
|
|
|
}
|
|
|
|
MSG_TYPES_LONG = {v: k for k, v in MSG_TYPES.items()}
|
|
|
|
|
|
|
|
MSG_TYPES_STATUS = {"I": 0, "C": 16, "R": 8, "W": 4, "E": 2, "F": 1}
|
2019-03-10 21:10:12 +00:00
|
|
|
|
2019-05-19 10:44:42 +00:00
|
|
|
# You probably don't want to change the MAIN_CHECKER_NAME
|
|
|
|
# This would affect rcfile generation and retro-compatibility
|
|
|
|
# on all project using [MASTER] in their rcfile.
|
|
|
|
MAIN_CHECKER_NAME = "master"
|
2019-05-19 10:10:25 +00:00
|
|
|
|
2019-03-10 21:10:12 +00:00
|
|
|
|
|
|
|
class WarningScope:
|
|
|
|
LINE = "line-based-msg"
|
|
|
|
NODE = "node-based-msg"
|
2020-05-03 18:24:32 +00:00
|
|
|
|
|
|
|
|
2021-04-04 12:37:19 +00:00
|
|
|
full_version = f"""pylint {__version__}
|
2021-03-27 14:21:29 +00:00
|
|
|
astroid {astroid.__version__}
|
|
|
|
Python {sys.version}"""
|