summaryrefslogtreecommitdiff
path: root/pylint/__main__.py
blob: 767746a2a72a039ce9ccbef0c26081e0b3d38bdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python

# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING

import os
import sys

import pylint

# Strip out the current working directory from sys.path.
# Having the working directory in `sys.path` means that `pylint` might
# inadvertently import user code from modules having the same name as
# stdlib or pylint's own modules.
# CPython issue: https://bugs.python.org/issue33053
if sys.path[0] == "" or sys.path[0] == os.getcwd():
    sys.path.pop(0)

pylint.run_pylint()