coc-pyright
Heyward FannPyright extension for coc.nvim, static type checker for Python
Published Package Summary
coc-pyright
Pyright extension for coc.nvim, with additional features:
- semanticTokens highlighting!
- inlayHints supports
- codeActions to add imports, ignore typing check, run tests and more
- linting with
bandit,flake8,mypy,ruff,prospector,pycodestyle,pydocstyle,pyflakes,pylama,pylint,pytype - formatting with
ruff,yapf,black,autopep8,darker,blackd,pyink - testing with
unittestorpytest, supports codeLens - sort imports with
ruff,isortandpyright - extract method and variables with
rope
Install
:CocInstall coc-pyright
Note: Pyright may not work as expected if can't detect project root correctly, check #521 and Using workspaceFolders in coc.nvim.
Configurations
These configurations are used by coc-pyright, you need to set them in your coc-settings.json.
| Configuration | Description | Default |
|---|---|---|
| pyright.enable | Enable coc-pyright extension | true |
| python.analysis.autoImportCompletions | Determines whether pyright offers auto-import completions | true |
| python.analysis.autoSearchPaths | Automatically add common search paths like 'src' | true |
| python.analysis.diagnosticMode | Analyzes and reports errors for open only or all files in workspace | openFilesOnly |
| python.analysis.stubPath | Path to directory containing custom type stub files | typings |
| python.analysis.typeshedPaths | Paths to look for typeshed modules | [] |
| python.analysis.diagnosticSeverityOverrides | Override the severity levels for individual diagnostics | {} |
| python.analysis.typeCheckingMode | Defines the default rule set for type checking | basic |
| python.analysis.useLibraryCodeForTypes | Use library implementations to extract type information | true |
| python.pythonPath | Path to Python | python |
| python.venvPath | Path to folder with a list of Virtual Environments | "" |
| python.formatting.provider | Provider for formatting | autopep8 |
| python.formatting.blackPath | Custom path to black | black |
| python.formatting.blackArgs | Arguments passed to black | [] |
| python.formatting.darkerPath | Custom path to darker | darker |
| python.formatting.darkerArgs | Arguments passed to darker | [] |
| python.formatting.pyinkPath | Custom path to pyink | pyink |
| python.formatting.pyinkArgs | Arguments passed to pyink | [] |
| python.formatting.blackdPath | Custom path to blackd | blackd |
| python.formatting.blackdHTTPURL | Custom blackd server url | "" |
| python.formatting.blackdHTTPHeaders | Custom blackd request headers | {} |
| python.formatting.yapfPath | Custom path to yapf | yapf |
| python.formatting.yapfArgs | Arguments passed to yapf | [] |
| python.formatting.autopep8Path | Custom path to autopep8 | autopep8 |
| python.formatting.autopep8Args | Arguments passed to autopep8 | [] |
| python.linting.enabled | Whether to lint Python files with external linters | true |
| python.linting.flake8Enabled | Whether to lint with flake8 | false |
| python.linting.banditEnabled | Whether to lint with bandit | false |
| python.linting.mypyEnabled | Whether to lint with mypy | false |
| python.linting.ruffEnabled | Whether to lint with ruff | false |
| python.linting.pytypeEnabled | Whether to lint with pytype | false |
| python.linting.pycodestyleEnabled | Whether to lint with pycodestyle | false |
| python.linting.prospectorEnabled | Whether to lint with prospector | false |
| python.linting.pydocstyleEnabled | Whether to lint with pydocstyle | false |
| python.linting.pylamaEnabled | Whether to lint with pylama | false |
| python.linting.pylintEnabled | Whether to lint with pylint | false |
| python.linting.pyflakesEnabled | Whether to lint with pyflakes | false |
| python.sortImports.path | Path to isort script, default using inner version | '' |
| python.sortImports.args | Arguments passed to isort | [] |
| pyright.server | Custom pyright-langserver path | '' |
| pyright.disableCompletion | Disable completion from Pyright | false |
| pyright.disableDiagnostics | Disable diagnostics from Pyright | false |
| pyright.disableDocumentation | Disable hover documentation from Pyright | false |
| pyright.disableProgressNotifications | Disable the initialization and workdone progress notifications | false |
| pyright.completion.importSupport | Enable python-import completion source support | true |
| pyright.completion.snippetSupport | Enable completion snippets support | true |
| pyright.organizeimports.provider | Organize imports provider, pyright, ruff or isort | pyright |
| pyright.inlayHints.functionReturnTypes | Enable inlay hints for function return types | true |
| pyright.inlayHints.variableTypes | Enable inlay hints for variable types | true |
| pyright.inlayHints.parameterTypes | Enable inlay hints for parameter types | true |
| pyright.testing.provider | Provider for testing, supports unittest and pytest | unittest |
| pyright.testing.unittestArgs | Arguments passed to unittest | [] |
| pyright.testing.pytestArgs | Arguments passed to pytest | [] |
Additional configuration options can be found in package.json.
pyrightconfig.json
Pyright supports pyrightconfig.json that provide granular control over settings.
Python typing and stub files
To provide best experience, Pyright requires packages to be type annotated and/or have stub files. The Python community is currently in a transition phase where package authors are actively looking to provide that. Meanwhile, stub files for well-known packages may also be obtained from 3rd party, for example:
Conda setup
-
Create the following file:
#!/bin/bash python "$@" -
Make it executable:
chmod +x $path -
Set
python.pythonPathin yourcoc-settings.json:"python.pythonPath": "<PUT PATH HERE>" -
Activate the environment before starting vim
This way python from your currently activated environment will be used
My Workflow with Pyright
- create venv in project:
python3 -m venv .venv source .venv/bin/activate- install modules with pip and work with Pyright
deactivate
License
MIT
This extension is built with create-coc-extension
- Pyright extension for coc.nvim, static type checker for Python
- onLanguage:python
- workspaceContains:app.py
- workspaceContains:Pipfile
- workspaceContains:setup.py
- workspaceContains:manage.py
- workspaceContains:pyproject.toml
- workspaceContains:requirements.txt
- workspaceContains:pyrightconfig.json
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion History
This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.
Contributed Commands
All contributes.commands entries from the published package manifest for coc-pyright@1.1.412.
| Command (:CocCommand) | Description |
|---|---|
| python.sortImports | Sort Imports by isort or ruff |
| python.runLinting | Run Linting |
| pyright.version | Show Pyright version |
| pyright.organizeimports | Organize Imports by Pyright |
| pyright.restartserver | Restart Server |
| pyright.fileTest | Run Test for Current File |
| pyright.singleTest | Run Test for Single (nearest) Test |
| pyright.createtypestub | Creates Type Stubs with given module name |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable coc-pyright extension"
}Raw JSON Schema
{
"type": "string",
"default": "",
"description": "Custom pyright-langserver path"
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "",
"description": "Path to folder with a list of Virtual Environments."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "python",
"description": "Path to Python, you can use a custom version of Python."
}Raw JSON Schema
{
"enum": [
"off",
"messages",
"verbose"
],
"type": "string",
"scope": "window",
"default": "off",
"description": "Trace requests to Pyright",
"enumDescriptions": [
"No traces",
"Error only",
"Full log"
]
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Paths of directories or files whose diagnostic output (errors and warnings) should be suppressed even if they are an included file or within the transitive closure of an included file. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character). If no value is provided, the value of python.linting.ignorePatterns (if set) will be used."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": true,
"description": "Whether to lint Python files with external linters, you can also disable diagnostics from Pyright by `pyright.disableDiagnostics` to use external linters only."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Paths of directories or files that should not be included. These override the include directories, allowing specific subdirectories to be excluded. Note that files in the exclude paths may still be included in the analysis if they are referenced (imported) by source files that are not excluded. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character). If no exclude paths are specified, pyright automatically excludes the following: `**/node_modules`, `**/__pycache__`, `.git` and any virtual environment directories."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Paths of directories or files that should be included. If no paths are specified, pyright defaults to the workspace root directory. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character)."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [
"--no-pretty",
"--ignore-missing-imports",
"--follow-imports=silent",
"--show-column-numbers"
],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "mypy",
"description": "Path to mypy, you can use a custom version of mypy by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "ruff",
"description": "Path to ruff, you can use a custom version of ruff by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "isort",
"description": "Path to isort script"
}Raw JSON Schema
{
"enum": [
"unittest",
"pytest"
],
"type": "string",
"default": "unittest",
"description": "Provider for testing, supports 'unittest' and 'pytest'."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": true,
"description": "Index installed third party libraries and user files for language features such as auto-import, add import, workspace symbols and etc."
}Raw JSON Schema
{
"enum": [
"Error",
"Warning",
"Information",
"Trace"
],
"type": "string",
"default": "Information",
"description": "Specifies the level of logging for the Output panel"
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "typings",
"description": "Path to directory containing custom type stub files."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": true,
"description": "Whether to run ruff via stdin."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Disable completion from Pyright"
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "bandit",
"description": "Path to bandit, you can use a custom version of bandit by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "flake8",
"description": "Path to flake8, you can use a custom version of flake8 by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": true,
"description": "Whether to lint Python files when saved."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "pylama",
"description": "Path to pylama, you can use a custom version of pylama by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "pylint",
"description": "Path to Pylint, you can use a custom version of pylint by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "pytype",
"description": "Path to pytype, you can use a custom version of mypy by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Disable diagnostics from Pyright"
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Disable hint diagnostics with special hints for grayed-out or strike-through text."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Additional import search resolution paths"
}Raw JSON Schema
{
"enum": [
"autopep8",
"darker",
"black",
"pyink",
"blackd",
"yapf",
"ruff",
"none"
],
"type": "string",
"scope": "resource",
"default": "autopep8",
"description": "Provider for formatting."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "ruff",
"description": "Path to ruff, you can use a custom version of ruff by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "yapf",
"description": "Path to yapf, you can use a custom version of yapf by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to run flake8 via stdin."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to lint Python files using mypy."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to run pylint via stdin."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to lint Python files using ruff."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "black",
"description": "Path to Black, you can use a custom version of Black by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "pyink",
"description": "Path to Pyink, you can use a custom version of pyink by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "pyflakes",
"description": "Path to pyflakes, you can use a custom version of pyflakes by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Disable hover documentation from Pyright"
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "blackd",
"description": "Path to blackd, you can use a custom version of blackd by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "darker",
"description": "Path to darker, you can use a custom version of darker by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to lint Python files using bandit."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to lint Python files using flake8"
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to lint Python files using pylama."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to lint Python files using pylint."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to lint Python files using pytype."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Paths to look for typeshed modules."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [
".vscode/*.py",
"**/site-packages/**/*.py"
],
"description": "Patterns used to exclude files or folders from being linted."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "prospector",
"description": "Path to Prospector, you can use a custom version of prospector by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "pydocstyle",
"description": "Path to pydocstyle, you can use a custom version of pydocstyle by modifying this setting to include the full path."
}Raw JSON Schema
{
"enum": [
"openFilesOnly",
"workspace"
],
"type": "string",
"scope": "resource",
"default": "openFilesOnly",
"enumDescriptions": [
"Analyzes and reports errors on only open files.",
"Analyzes and reports errors on all files in the workspace."
]
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "autopep8",
"description": "Path to autopep8, you can use a custom version of autopep8 by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "Arguments passed in. Each argument is a separate item in the array."
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "pycodestyle",
"description": "Path to pycodestyle, you can use a custom version of pycodestyle by modifying this setting to include the full path."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to lint Python files using pyflakes."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": true,
"description": "Automatically add common search paths like 'src'?"
}Raw JSON Schema
{
"type": "string",
"scope": "resource",
"default": "",
"description": "Custom blackd server url."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable `python-import` completion source, will list suggestions after input `import`"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable/disable inlay hints for variable types"
}Raw JSON Schema
{
"enum": [
"pyright",
"ruff",
"isort"
],
"type": "string",
"default": "pyright",
"description": "Organize imports provider"
}Raw JSON Schema
{
"enum": [
"off",
"basic",
"standard",
"strict"
],
"type": "string",
"scope": "resource",
"default": "standard",
"description": "Defines the default rule set for type checking."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to lint Python files using prospector."
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to lint Python files using pydocstyle"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable completion snippets support"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable/disable inlay hints for parameter types"
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": false,
"description": "Whether to lint Python files using pycodestyle"
}Raw JSON Schema
{
"type": "number",
"scope": "resource",
"default": 100,
"description": "Controls the maximum number of problems produced by the server."
}Raw JSON Schema
{
"type": "object",
"scope": "resource",
"default": {},
"markdownDescription": "Custom headers POST to blackd server, checkout <https://black.readthedocs.io/en/stable/usage_and_configuration/black_as_a_server.html#protocol>"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Disable the initialization and workdone progress notifications"
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": true,
"description": "Offer auto-import completions."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable/disable inlay hints for function return types"
}Raw JSON Schema
{
"type": "boolean",
"scope": "resource",
"default": true,
"description": "Use library implementations to extract type information when type stub is not present."
}Raw JSON Schema
{
"enum": [
"Hint",
"Error",
"Information",
"Warning"
],
"type": "string",
"scope": "resource",
"default": "Error",
"description": "Severity of Flake8 message type 'E'."
}Raw JSON Schema
{
"enum": [
"Hint",
"Error",
"Information",
"Warning"
],
"type": "string",
"scope": "resource",
"default": "Error",
"description": "Severity of Flake8 message type 'F'."
}Raw JSON Schema
{
"enum": [
"Hint",
"Error",
"Information",
"Warning"
],
"type": "string",
"scope": "resource",
"default": "Warning",
"description": "Severity of Flake8 message type 'W'."
}Raw JSON Schema
{
"enum": [
"Hint",
"Error",
"Information",
"Warning"
],
"type": "string",
"scope": "resource",
"default": "Information",
"description": "Severity of Mypy message type 'Note'."
}Raw JSON Schema
{
"enum": [
"Hint",
"Error",
"Information",
"Warning"
],
"type": "string",
"scope": "resource",
"default": "Error",
"description": "Severity of Mypy message type 'Error'."
}Raw JSON Schema
{
"type": "object",
"scope": "resource",
"properties": {
"reportCallIssue": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for issues involving call expressions and arguments."
},
"reportDeprecated": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for use of deprecated classes or functions."
},
"reportIndexIssue": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics related to index operations and expressions."
},
"reportReturnType": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics related to function return type compatibility."
},
"reportUnhashable": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for the use of an unhashable object in a container that requires hashability."
},
"reportUnusedClass": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for a class with a private name (starting with an underscore) that is not accessed."
},
"reportArgumentType": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for a type incompatibility for an argument to a call."
},
"reportImportCycles": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for cyclical import chains. These are not errors in Python, but they do slow down type analysis and often hint at architectural layering issues. Generally, they should be avoided."
},
"reportOptionalCall": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for an attempt to call a variable with an Optional type."
},
"reportPrivateUsage": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for incorrect usage of private or protected variables or functions. Protected class members begin with a single underscore _ and can be accessed only by subclasses. Private class members begin with a double underscore but do not end in a double underscore and can be accessed only within the declaring class. Variables and functions declared outside of a class are considered private if their names start with either a single or double underscore, and they cannot be accessed outside of the declaring module."
},
"reportUnusedExcept": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for unreachable except clause."
},
"reportUnusedImport": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for an imported symbol that is not referenced within that file."
},
"reportAbstractUsage": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for an attempt to instantiate an abstract or protocol class or use an abstract method."
},
"reportOperatorIssue": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for related to unary or binary operators."
},
"reportRedeclaration": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for an attempt to declare the type of a symbol multiple times."
},
"reportAssignmentType": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for type incompatibilities for assignments."
},
"reportIncompleteStub": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for the use of a module-level “__getattr__” function, indicating that the stub is incomplete."
},
"reportMissingImports": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for imports that have no corresponding imported python file or type stub file."
},
"reportUnusedFunction": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for a function or method with a private name (starting with an underscore) that is not accessed."
},
"reportUnusedVariable": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for a variable that is not accessed."
},
"reportDuplicateImport": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for an imported symbol or module that is imported more than once."
},
"reportInvalidTypeForm": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for type expression that uses an invalid form."
},
"reportOptionalOperand": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for an attempt to use an Optional type as an operand to a binary or unary operator (like '+', '<<', '~')."
},
"reportUnboundVariable": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for the use of unbound variables."
},
"reportUnnecessaryCast": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for 'cast' calls that are statically determined to be unnecessary. Such calls are sometimes indicative of a programming error."
},
"reportUnusedCoroutine": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for call expressions that return a Coroutine and whose results are not consumed."
},
"reportAssertAlwaysTrue": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "warning",
"description": "Diagnostics for 'assert' statement that will provably always assert. This can be indicative of a programming error."
},
"reportImplicitOverride": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for overridden methods that do not include an `@override` decorator."
},
"reportMissingSuperCall": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for missing call to parent class for inherited `__init__` methods."
},
"reportMissingTypeStubs": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for imports that have no corresponding type stub file (either a typeshed file or a custom type stub). The type checker requires type stubs to do its best job at analysis."
},
"reportOptionalIterable": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for an attempt to use an Optional type as an iterable value (e.g. within a for statement)."
},
"reportTypeCommentUsage": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for usage of deprecated type comments."
},
"reportUntypedBaseClass": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for base classes whose type cannot be determined statically. These obscure the class type, defeating many type analysis features."
},
"reportUnusedCallResult": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for call expressions whose results are not consumed and are not None."
},
"reportUnusedExpression": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "warning",
"description": "Diagnostics for simple expressions whose value is not used in any way."
},
"reportAssertTypeFailure": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for a type incompatibility detected by a typing.assert_type call."
},
"reportGeneralTypeIssues": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for general type inconsistencies, unsupported operations, argument/parameter mismatches, etc. Covers all of the basic type-checking rules not covered by other rules. Does not include syntax errors."
},
"reportInvalidTypeVarUse": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "warning",
"description": "Diagnostics for improper use of type variables in a function signature."
},
"reportOptionalSubscript": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for an attempt to subscript (index) a variable with an Optional type."
},
"reportUndefinedVariable": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for undefined variables."
},
"reportUnknownLambdaType": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for input or return parameters for lambdas that have an unknown type."
},
"reportUnknownMemberType": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for class or instance variables that have an unknown type."
},
"reportUntypedNamedTuple": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics when “namedtuple” is used rather than “NamedTuple”. The former contains no type information, whereas the latter does."
},
"reportMatchNotExhaustive": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for 'match' statements that do not exhaustively match all possible values."
},
"reportPrivateImportUsage": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for incorrect usage of symbol imported from a \"py.typed\" module that is not re-exported from that module."
},
"reportMissingModuleSource": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "warning",
"description": "Diagnostics for imports that have no corresponding source file. This happens when a type stub is found, but the module source file was not found, indicating that the code may fail at runtime when using this execution environment. Type checking will be done using the type stub."
},
"reportMissingTypeArgument": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for generic class reference with missing type arguments."
},
"reportOverlappingOverload": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for function overloads that overlap in signature and obscure each other or have incompatible return types."
},
"reportUnknownArgumentType": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for call arguments for functions or methods that have an unknown type."
},
"reportUnknownVariableType": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for variables that have an unknown type.."
},
"reportUnnecessaryContains": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for 'in' operation that is statically determined to be unnecessary. Such operations are sometimes indicative of a programming error."
},
"reportAttributeAccessIssue": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for issues involving attribute accesses."
},
"reportConstantRedefinition": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for attempts to redefine variables whose names are all-caps with underscores and numerals."
},
"reportFunctionMemberAccess": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for member accesses on functions."
},
"reportInconsistentOverload": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for inconsistencies between function overload signatures and implementation."
},
"reportInvalidStubStatement": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for type stub statements that do not conform to PEP 484."
},
"reportInvalidTypeArguments": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for invalid type argument usage."
},
"reportMissingParameterType": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for parameters that are missing a type annotation."
},
"reportOptionalMemberAccess": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for an attempt to access a member of a variable with an Optional type."
},
"reportPropertyTypeMismatch": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for property whose setter and getter have mismatched types."
},
"reportSelfClsParameterName": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "warning",
"description": "Diagnostics for a missing or misnamed “self” parameter in instance methods and “cls” parameter in class methods. Instance methods in metaclasses (classes that derive from “type”) are allowed to use “cls” for instance methods."
},
"reportUnknownParameterType": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for input or return parameters for functions or methods that have an unknown type."
},
"reportUnsupportedDunderAll": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "warning",
"description": "Diagnostics for unsupported operations performed on __all__."
},
"reportUnnecessaryComparison": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for '==' and '!=' comparisons that are statically determined to be unnecessary. Such calls are sometimes indicative of a programming error."
},
"reportUnnecessaryIsInstance": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for 'isinstance' or 'issubclass' calls where the result is statically determined to be always true. Such calls are often indicative of a programming error."
},
"reportUntypedClassDecorator": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for class decorators that have no type annotations. These obscure the class type, defeating many type analysis features."
},
"reportOptionalContextManager": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for an attempt to use an Optional type as a context manager (as a parameter to a with statement)."
},
"reportInconsistentConstructor": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for __init__ and __new__ methods whose signatures are inconsistent."
},
"reportPossiblyUnboundVariable": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for the use of variables that may be unbound on some code paths."
},
"reportCallInDefaultInitializer": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for function calls within a default value initialization expression. Such calls can mask expensive operations that are performed at module initialization time."
},
"reportNoOverloadImplementation": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for an overloaded function or method with a missing implementation."
},
"reportUntypedFunctionDecorator": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for function decorators that have no type annotations. These obscure the function type, defeating many type analysis features."
},
"reportWildcardImportFromLibrary": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "warning",
"description": "Diagnostics for an wildcard import from an external library."
},
"reportIncompatibleMethodOverride": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for methods that override a method of the same name in a base class in an incompatible manner (wrong number of parameters, incompatible parameter types, or incompatible return type)."
},
"reportTypedDictNotRequiredAccess": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for an attempt to access a non-required key within a TypedDict without a check for its presence."
},
"reportImplicitStringConcatenation": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for two or more string literals that follow each other, indicating an implicit concatenation. This is considered a bad practice and often masks bugs such as missing commas."
},
"reportInvalidStringEscapeSequence": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "warning",
"description": "Diagnostics for invalid escape sequences used within string literals. The Python specification indicates that such sequences will generate a syntax error in future versions."
},
"reportIncompatibleVariableOverride": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "error",
"description": "Diagnostics for overrides in subclasses that redefine a variable in an incompatible way."
},
"reportUnnecessaryTypeIgnoreComment": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for '# type: ignore' comments that have no effect."
},
"reportUninitializedInstanceVariable": {
"enum": [
"none",
"information",
"warning",
"error",
true,
false
],
"type": [
"string",
"boolean"
],
"default": "none",
"description": "Diagnostics for instance variables that are not declared or initialized within class body or `__init__` method."
}
},
"description": "Allows a user to override the severity levels for individual diagnostics. Use the rule name as a key and one of \"error\", \"warning\", \"information\", \"none\", `true` (alias for \"error\") or `false` (alias for \"none\") as value. The default value shown for each diagnostic is the default when \"python.analysis.typeCheckingMode\" is set to \"standard\". See [here](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#diagnostic-rule-defaults) for defaults for each type checking mode (\"off\", \"basic\", \"standard\", and \"strict\")."
}Raw JSON Schema
{
"enum": [
"Hint",
"Error",
"Information",
"Warning"
],
"type": "string",
"scope": "resource",
"default": "Error",
"description": "Severity of Pylint message type 'Error/E'."
}Raw JSON Schema
{
"enum": [
"Hint",
"Error",
"Information",
"Warning"
],
"type": "string",
"scope": "resource",
"default": "Error",
"description": "Severity of Pylint message type 'Fatal/F'."
}Raw JSON Schema
{
"enum": [
"Hint",
"Error",
"Information",
"Warning"
],
"type": "string",
"scope": "resource",
"default": "Error",
"description": "Severity of pycodestyle message type 'E'."
}Raw JSON Schema
{
"enum": [
"Hint",
"Error",
"Information",
"Warning"
],
"type": "string",
"scope": "resource",
"default": "Warning",
"description": "Severity of pycodestyle message type 'W'."
}Raw JSON Schema
{
"enum": [
"Hint",
"Error",
"Information",
"Warning"
],
"type": "string",
"scope": "resource",
"default": "Warning",
"description": "Severity of Pylint message type 'Warning/W'."
}Raw JSON Schema
{
"enum": [
"Hint",
"Error",
"Information",
"Warning"
],
"type": "string",
"scope": "resource",
"default": "Hint",
"description": "Severity of Pylint message type 'Refactor/R'."
}Raw JSON Schema
{
"enum": [
"Hint",
"Error",
"Information",
"Warning"
],
"type": "string",
"scope": "resource",
"default": "Information",
"description": "Severity of Pylint message type 'Convention/C'."
}

