Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs for pylint.args #599

Open
sriramv2 opened this issue Feb 25, 2025 · 0 comments
Open

Improve docs for pylint.args #599

sriramv2 opened this issue Feb 25, 2025 · 0 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.
Milestone

Comments

@sriramv2
Copy link

Diagnostic Data

  • Python version (& distribution if applicable, e.g., Anaconda): 3.10.12
  • Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): virtualenv
  • Operating system (and version): Ubuntu22.04
  • Version of tool extension you are using: 2024.2.0

Behaviour

Expected Behavior

Documentation should suggest that arguments need to be specified without the "pylint.args". Adding the "pylint.args" = [] overwrites the arguments that VSCode starts Pylint with.

Actual Behavior

Following the docs and setting "pylint.args" = ["--init-hook=import os;"] leads to:

File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/tool/lsp_server.py", line 791, in _run_tool_on_document
result = utils.run_module(
File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/tool/lsp_utils.py", line 208, in run_module
return _run_module(module, argv, use_stdin, source)
File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/tool/lsp_utils.py", line 193, in _run_module
runpy.run_module(module, run_name="main")
File "/usr/lib/python3.10/runpy.py", line 227, in run_module
return _run_code(code, {}, init_globals, run_name, mod_spec)
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/libs/pylint/main.py", line 10, in
pylint.run_pylint()
File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/libs/pylint/init.py", line 34, in run_pylint
PylintRun(argv or sys.argv[1:])
File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/libs/pylint/lint/run.py", line 211, in init
linter.check(args)
File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/libs/pylint/lint/pylinter.py", line 664, in check
raise exceptions.InvalidArgsError(
pylint.exceptions.InvalidArgsError: Missing filename required for --from-stdin

Reproduction Steps:

Set pylint.args according to VSCode's pylint extension.

Logs:

Following the docs and setting "pylint.args" = ["--init-hook=import os;"] leads to:

File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/tool/lsp_server.py", line 791, in _run_tool_on_document
result = utils.run_module(
File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/tool/lsp_utils.py", line 208, in run_module
return _run_module(module, argv, use_stdin, source)
File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/tool/lsp_utils.py", line 193, in _run_module
runpy.run_module(module, run_name="main")
File "/usr/lib/python3.10/runpy.py", line 227, in run_module
return _run_code(code, {}, init_globals, run_name, mod_spec)
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/libs/pylint/main.py", line 10, in
pylint.run_pylint()
File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/libs/pylint/init.py", line 34, in run_pylint
PylintRun(argv or sys.argv[1:])
File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/libs/pylint/lint/run.py", line 211, in init
linter.check(args)
File "/home/user/.vscode/extensions/ms-python.pylint-2024.2.0/bundled/libs/pylint/lint/pylinter.py", line 664, in check
raise exceptions.InvalidArgsError(
pylint.exceptions.InvalidArgsError: Missing filename required for --from-stdin

@sriramv2 sriramv2 added the bug Issue identified by VS Code Team member as probable bug label Feb 25, 2025
@github-actions github-actions bot added the triage-needed Issue is not triaged. label Feb 25, 2025
@karthiknadig karthiknadig added this to the March 2025 milestone Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.
Projects
None yet
Development

No branches or pull requests

3 participants