Skip to content

Commit 6d52a87

Browse files
committed
Phase out old names
1 parent 89fb20d commit 6d52a87

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

pylsp_mypy/plugin.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import shutil
1717
import subprocess
1818
import tempfile
19-
import warnings
2019
from pathlib import Path
2120
from typing import IO, Any, Dict, List, Optional
2221

@@ -147,17 +146,13 @@ def pylsp_lint(
147146
settings = config.plugin_settings("pylsp_mypy")
148147
oldSettings1 = config.plugin_settings("mypy-ls")
149148
if oldSettings1 != {}:
150-
warnings.warn(
151-
DeprecationWarning(
152-
"Your configuration uses the namespace mypy-ls, this should be changed to pylsp_mypy"
153-
)
149+
raise DeprecationWarning(
150+
"Your configuration uses the namespace mypy-ls, this should be changed to pylsp_mypy"
154151
)
155152
oldSettings2 = config.plugin_settings("mypy_ls")
156153
if oldSettings2 != {}:
157-
warnings.warn(
158-
DeprecationWarning(
159-
"Your configuration uses the namespace mypy_ls, this should be changed to pylsp_mypy"
160-
)
154+
raise DeprecationWarning(
155+
"Your configuration uses the namespace mypy_ls, this should be changed to pylsp_mypy"
161156
)
162157
if settings == {}:
163158
settings = oldSettings1
@@ -376,11 +371,9 @@ def findConfigFile(path: str, names: List[str]) -> Optional[str]:
376371
file = parent.joinpath(name)
377372
if file.is_file():
378373
if file.name in ["mypy-ls.cfg", "mypy_ls.cfg"]:
379-
warnings.warn(
380-
DeprecationWarning(
381-
f"{str(file)}: {file.name} is no longer supported, you should rename your "
382-
"config file to pylsp-mypy.cfg"
383-
)
374+
raise DeprecationWarning(
375+
f"{str(file)}: {file.name} is no longer supported, you should rename your "
376+
"config file to pylsp-mypy.cfg or preferably use a pyproject.toml instead."
384377
)
385378
if file.name == "pyproject.toml":
386379
isPluginConfig = "pylsp-mypy.cfg" in names

0 commit comments

Comments
 (0)