From afdc10e3708614626af41df059b02d4d0c4fba4d Mon Sep 17 00:00:00 2001 From: Thibaut de Saivre <thibaut.de-saivre@polytechnique.edu> Date: Wed, 8 Nov 2023 14:15:03 +0100 Subject: [PATCH] add more settings for python pylance --- python/.vscode/settings.json | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/python/.vscode/settings.json b/python/.vscode/settings.json index 68cbb82..b43fb43 100644 --- a/python/.vscode/settings.json +++ b/python/.vscode/settings.json @@ -14,9 +14,23 @@ }, "python.analysis.typeCheckingMode": "strict", // or "strict" : use stricter python type checking + // Deactivate some warnings because there are many python libs that do not respect strict typing + "python.analysis.diagnosticSeverityOverrides": { + "reportMissingTypeStubs": "none", // Scipy does not have type stubs + "reportUnknownMemberType": "none", // Member types are not complete for numpy + "reportUnknownVariableType": "none", // Skimage.io has unknown variable types + "reportUnknownArgumentType": "none", + "reportUnknownParameterType": "none", // Disable warnings when a type is partially unknown + "reportUnknownLambdaType": "none", + + // Set severity to Warning + "reportUnusedVariable": "warning", + "reportMissingParameterType": "warning", + "reportGeneralTypeIssues": "none" + }, // Add explicit hints overlays for arguments, return types, variable types... "python.analysis.inlayHints.functionReturnTypes": true, - "python.analysis.inlayHints.variableTypes": true, + "python.analysis.inlayHints.variableTypes": false, // Deactivate variable type inlays (they clutter the view) "python.analysis.inlayHints.pytestParameters": true, - "python.analysis.inlayHints.callArgumentNames": "all" + "python.analysis.inlayHints.callArgumentNames": "partial" // Do not show argument names when the variable has the same name } -- GitLab