You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Disable pylintUseMinimalCheckers when local pylint config exists #788
I understand that it makes sense to hide some errors by default but if a project explicitly configures the linter then I think the editor should not override local choices. I am specifically talking about cases where one of the following is true:
.pylintrc exists
pylintrc exists
PYLINTRC environment variable is set and points to an existing file
You can specify a configuration file on the command line using the --rcfile option. Otherwise, Pylint searches for a configuration file in the following order and uses the first one it finds:
pylintrc in the current working directory
.pylintrc in the current working directory
If the current working directory is in a Python module, Pylint searches up the hierarchy of Python modules until it finds a pylintrc file. This allows you to specify coding standards on a module-by-module basis. Of course, a directory is judged to be a Python module if it contains an __init__.py file.
The file named by environment variable PYLINTRC
if you have a home directory which isn’t /root:
a.pylintrc in your home directory
b. config/pylintrc in your home directory
Activity
MikhailArkhipov commentedon Feb 15, 2018
It should become disabled. See https://github.com/Microsoft/vscode-python/blob/master/src/client/linters/pylint.ts,
hasConfigurationFile. Logic copied from pylint itself. Can you provide repro when it doesn't?parkerd commentedon Feb 15, 2018
There's a faulty assumption at https://github.com/Microsoft/vscode-python/blob/master/src/client/linters/pylint.ts#L82-L84 that the directory should have
__init__.py, which generally won't be true if.pylintrcis at the root of a repo.For reference, this is the relevant logic in pylint: https://github.com/PyCQA/pylint/blob/master/pylint/config.py#L106-L113 . It will look
..one directory from the last__init__.py, instead of leaving the loop when there is none.MikhailArkhipov commentedon Feb 16, 2018
Makes sense. Thank you.
MikhailArkhipov commentedon Feb 16, 2018
The assumption was based on
which appears to only walk up the tree if
__init.py__is present...https://pylint.readthedocs.io/en/latest/user_guide/run.html#command-line-options
You can specify a configuration file on the command line using the --rcfile option. Otherwise, Pylint searches for a configuration file in the following order and uses the first one it finds:
__init__.pyfile.a.pylintrc in your home directory
b. config/pylintrc in your home directory
MikhailArkhipov commentedon Feb 16, 2018
Actual problem is that check for the config file happens before
runand thenrunchanges current working directory to the workspace root.