A. Disabling the complete code diagnostics worked to get rid of pycodestyle warnings:
B. There is a json editor shown on the top right of the settings editor that can be used to adapt the settings of the Languageserver.
C. Some aspects that might be confusing:
a) The settings depend on the installed version of jupyterlab-lsp. Update for example with
pip install jupyterlab-lsp --upgrade
pip install 'python-lsp-server[all]' --upgrade
(Installation of a new version might delete your existing user preferences of the language server.)
Documentation of the current configuration style:
https://github.com/krassowski/jupyterlab-lsp#configuring-the-servers
b) When you copy the default settings to the right window, you cannot simply out comment the examples in the doc string to enable them. Instead, the code snippets need to be copied to the right location inside the main element "language_servers" and add some quotation marks around the keys.
c) In some versions, instead of the name "pycodestyle" a different term "pydocstyle" is used in the settings.
d) In some versions, the outdated term "pyls" has not been consistently replaced, yet.
D. Example settings to disable pycodestyle and pyflakes and enable pylint for jupyterlab-lsp version 4.2.0:
{
// Language Server
// @jupyter-lsp/jupyterlab-lsp:plugin
// Language Server Protocol settings.
// **********************************
// Language Server
// Language-server specific configuration, keyed by implementation, e.g:
//
// pyls: {
// serverSettings: {
// pyls: {
// plugins: {
// pydocstyle: {
// enabled: true
// },
// pyflakes: {
// enabled: false
// },
// flake8: {
// enabled: true
// }
// }
// }
// }
// }
//
// Alternatively, using dotted naming convention:
//
// pyls: {
// serverSettings: {
// "pyls.plugins.pydocstyle.enabled": true,
// "pyls.plugins.pyflakes.enabled": false,
// "pyls.plugins.flake8.enabled": true
// }
// }
"language_servers": {
"julia-language-server": {
"serverSettings": {
"julia.lint.run": true,
"julia.lint.missingrefs": "none",
"julia.lint.disabledDirs": [
"docs",
"test"
],
"julia.lint.call": true,
"julia.lint.iter": true,
"julia.lint.nothingcomp": true,
"julia.lint.constif": true,
"julia.lint.lazy": true,
"julia.lint.datadecl": true,
"julia.lint.typeparam": true,
"julia.lint.modname": true,
"julia.lint.pirates": true,
"julia.lint.useoffuncargs": true,
"julia.completionmode": "qualify"
}
},
"pylsp": {
"serverSettings": {
"pylsp.configurationSources": [
"pycodestyle"
],
"pylsp.plugins.flake8.config": null,
"pylsp.plugins.flake8.enabled": false,
"pylsp.plugins.flake8.exclude": [],
"pylsp.plugins.flake8.executable": "flake8",
"pylsp.plugins.flake8.filename": null,
"pylsp.plugins.flake8.hangClosing": null,
"pylsp.plugins.flake8.ignore": [],
"pylsp.plugins.flake8.maxLineLength": null,
"pylsp.plugins.flake8.indentSize": null,
"pylsp.plugins.flake8.perFileIgnores": [],
"pylsp.plugins.flake8.select": null,
"pylsp.plugins.jedi.extra_paths": [],
"pylsp.plugins.jedi.env_vars": null,
"pylsp.plugins.jedi.environment": null,
"pylsp.plugins.jedi_completion.enabled": true,
"pylsp.plugins.jedi_completion.include_params": true,
"pylsp.plugins.jedi_completion.include_class_objects": true,
"pylsp.plugins.jedi_completion.fuzzy": false,
"pylsp.plugins.jedi_completion.eager": false,
"pylsp.plugins.jedi_completion.resolve_at_most": 25,
"pylsp.plugins.jedi_completion.cache_for": [
"pandas",
"numpy",
"tensorflow",
"matplotlib"
],
"pylsp.plugins.jedi_definition.enabled": true,
"pylsp.plugins.jedi_definition.follow_imports": true,
"pylsp.plugins.jedi_definition.follow_builtin_imports": true,
"pylsp.plugins.jedi_hover.enabled": true,
"pylsp.plugins.jedi_references.enabled": true,
"pylsp.plugins.jedi_signature_help.enabled": true,
"pylsp.plugins.jedi_symbols.enabled": true,
"pylsp.plugins.jedi_symbols.all_scopes": true,
"pylsp.plugins.jedi_symbols.include_import_symbols": true,
"pylsp.plugins.mccabe.enabled": true,
"pylsp.plugins.mccabe.threshold": 15,
"pylsp.plugins.preload.enabled": true,
"pylsp.plugins.preload.modules": [],
"pylsp.plugins.pycodestyle.enabled": false,
"pylsp.plugins.pycodestyle.exclude": [],
"pylsp.plugins.pycodestyle.filename": [],
"pylsp.plugins.pycodestyle.select": [],
"pylsp.plugins.pycodestyle.ignore": [],
"pylsp.plugins.pycodestyle.hangClosing": null,
"pylsp.plugins.pycodestyle.maxLineLength": null,
"pylsp.plugins.pycodestyle.indentSize": null,
"pylsp.plugins.pydocstyle.enabled": false,
"pylsp.plugins.pydocstyle.convention": null,
"pylsp.plugins.pydocstyle.addIgnore": [],
"pylsp.plugins.pydocstyle.addSelect": [],
"pylsp.plugins.pydocstyle.ignore": [],
"pylsp.plugins.pydocstyle.select": [],
"pylsp.plugins.pydocstyle.match": "(?!test_).*\\.py",
"pylsp.plugins.pydocstyle.matchDir": "[^\\.].*",
"pylsp.plugins.pyflakes.enabled": false,
"pylsp.plugins.pylint.enabled": true,
"pylsp.plugins.pylint.args": [],
"pylsp.plugins.pylint.executable": null,
"pylsp.plugins.rope_completion.enabled": false,
"pylsp.plugins.rope_completion.eager": false,
"pylsp.plugins.yapf.enabled": true,
"pylsp.rope.extensionModules": null,
"pylsp.rope.ropeFolder": null
}
},
"r-languageserver": {
"serverSettings": {
"r.lsp.debug": true,
"r.lsp.log_file": null,
"r.lsp.diagnostics": true,
"r.lsp.rich_documentation": true,
"r.lsp.snippet_support": true,
"r.lsp.max_completions": 200,
"r.lsp.lint_cache": false,
"r.lsp.link_file_size_limit": 16384
}
},
"texlab": {
"serverSettings": {
"rootDirectory": null,
"build.executable": "latexmk",
"build.args": [
"-pdf",
"-interaction=nonstopmode",
"-synctex=1",
"%f"
],
"build.onSave": false,
"build.outputDirectory": ".",
"build.forwardSearchAfter": false,
"forwardSearch.executable": null,
"forwardSearch.args": [],
"chktex.onOpenAndSave": false,
"chktex.onEdit": false,
"diagnosticsDelay": 300,
"formatterLineLength": 80,
"latexFormatter": "latexindent",
"latexindent.local": null,
"latexindent.modifyLineBreaks": false
}
}
},
// Log all LSP communication with the LSP servers
// Whether all messages sent to and received from LSP servers should be logged into the console. To see these messages, set loggingLevel to debug or log. Note: Only messages handled by the new API will be shown.
"logAllCommunication": false,
// Logging console type
// The console to use for debugging problems with this extension. Allowed values are: browser, floating.
"loggingConsole": "browser",
// Logging console verbosity level
// The verbosity of the console for debugging problems with this extension. Allowed values are: debug, log, warn, error.
"loggingLevel": "warn",
// Ask servers to send trace notifications
// Whether to ask server to send logs with execution trace (for debugging). To see these messages, set loggingLevel to debug or log. Accepted values are: "off", "messages", "verbose". Servers are allowed to ignore this request.
"setTrace": null
}
E: Configure pylint
You can specify the path to a pylint configuration file, for example
"pylsp.plugins.pylint.args": ["--rcfile ../../pyproject.toml"],