@@ -163,6 +163,18 @@ Only available in Emacs 27 and above."
163
163
:type 'list
164
164
:group 'lsp-pyright )
165
165
166
+ (defcustom lsp-pyright-diagnostic-severity-overrides '()
167
+ " Overrides certain rules severity leve l"
168
+ :group 'lsp-pyright
169
+ :type `(alist :key-type (string :tag " Rule Name" )
170
+ :value-type (choice
171
+ (const :tag " No Error" " none" )
172
+ (const :tag " Warning" " warning" )
173
+ (const :tag " Information" " information" )
174
+ (const :tag " Error" " error" )
175
+ (const :tag " An error is generated" t )
176
+ (const :tag " No error is generated" , json-false ))))
177
+
166
178
(defcustom lsp-pyright-basedpyright-inlay-hints-variable-types t
167
179
" Whether to show inlay hints on assignments to variables.
168
180
@@ -256,6 +268,8 @@ Current LSP WORKSPACE should be passed in."
256
268
(,(concat lsp-pyright-langserver-command " .disableOrganizeImports" ) lsp-pyright-disable-organize-imports t )
257
269
(,(concat lsp-pyright-langserver-command " .disableTaggedHints" ) lsp-pyright-disable-tagged-hints t )
258
270
(,(concat lsp-pyright-langserver-command " .typeCheckingMode" ) lsp-pyright-type-checking-mode)
271
+ (,(concat lsp-pyright-langserver-command " .analysis.diagnosticSeverityOverrides" ) (lambda () (ht-from-alist lsp-pyright-diagnostic-severity-overrides)))
272
+ (" python.analysis.diagnosticSeverityOverrides" (lambda () (ht-from-alist lsp-pyright-diagnostic-severity-overrides)))
259
273
(" basedpyright.analysis.inlayHints.variableTypes" lsp-pyright-basedpyright-inlay-hints-variable-types t )
260
274
(" basedpyright.analysis.inlayHints.callArgumentNames" lsp-pyright-basedpyright-inlay-hints-call-argument-names t )
261
275
(" basedpyright.analysis.inlayHints.functionReturnTypes" lsp-pyright-basedpyright-inlay-hints-function-return-types t )
0 commit comments