mirror of
https://fuchsia.googlesource.com/third_party/github.com/pylint-dev/pylint
synced 2024-09-21 16:19:21 +00:00
d8069ddc9f
* Simplify the way builtins is used (remove astroid dependencies) * Replace the constant BUILTINS by the string 'builtins' This make for clearer and also slightly faster code (means time seems to decrease by 0.68% with this change alone (astroid/pylint) in the pylint tests benchmarks). Done because we were using an import from astroid from astroid.bases for one of those, which is kinda messy.
52 lines
1.3 KiB
Python
52 lines
1.3 KiB
Python
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
|
|
import platform
|
|
import sys
|
|
|
|
import astroid
|
|
|
|
from pylint.__pkginfo__ import __version__
|
|
|
|
PY38_PLUS = sys.version_info[:2] >= (3, 8)
|
|
PY39_PLUS = sys.version_info[:2] >= (3, 9)
|
|
PY310_PLUS = sys.version_info[:2] >= (3, 10)
|
|
|
|
IS_PYPY = platform.python_implementation() == "PyPy"
|
|
|
|
PY_EXTS = (".py", ".pyc", ".pyo", ".pyw", ".so", ".dll")
|
|
|
|
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}
|
|
|
|
# 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"
|
|
|
|
|
|
class WarningScope:
|
|
LINE = "line-based-msg"
|
|
NODE = "node-based-msg"
|
|
|
|
|
|
full_version = f"""pylint {__version__}
|
|
astroid {astroid.__version__}
|
|
Python {sys.version}"""
|