Skip to content

Commit 12cdaa1

Browse files
committed
closes #15
1 parent a780119 commit 12cdaa1

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

pylsp_mypy/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.5.1"
1+
__version__ = "0.5.2"

pylsp_mypy/plugin.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from typing import Optional, Dict, Any, IO, List
2020
import atexit
2121
import collections
22+
import warnings
2223

2324
line_pattern: str = r"((?:^[a-z]:)?[^:]+):(?:(\d+):)?(?:(\d+):)? (\w+): (.*)"
2425

@@ -121,13 +122,17 @@ def pylsp_lint(
121122
settings = config.plugin_settings("pylsp_mypy")
122123
oldSettings1 = config.plugin_settings("mypy-ls")
123124
if oldSettings1 != {}:
124-
raise DeprecationWarning(
125-
"Your configuration uses the namespace mypy-ls, this should be changed to pylsp_mypy"
125+
warnings.warn(
126+
DeprecationWarning(
127+
"Your configuration uses the namespace mypy-ls, this should be changed to pylsp_mypy"
128+
)
126129
)
127130
oldSettings2 = config.plugin_settings("mypy_ls")
128131
if oldSettings2 != {}:
129-
raise DeprecationWarning(
130-
"Your configuration uses the namespace mypy_ls, this should be changed to pylsp_mypy"
132+
warnings.warn(
133+
DeprecationWarning(
134+
"Your configuration uses the namespace mypy_ls, this should be changed to pylsp_mypy"
135+
)
131136
)
132137
if settings == {}:
133138
settings = oldSettings1
@@ -294,9 +299,11 @@ def findConfigFile(path: str, names: List[str]) -> Optional[str]:
294299
file = parent.joinpath(name)
295300
if file.is_file():
296301
if file.name in ["mypy-ls.cfg", "mypy_ls.cfg"]:
297-
raise DeprecationWarning(
298-
f"{str(file)}: {file.name} is no longer supported, you should rename your "
299-
"config file to pylsp-mypy.cfg"
302+
warnings.warn(
303+
DeprecationWarning(
304+
f"{str(file)}: {file.name} is no longer supported, you should rename your "
305+
"config file to pylsp-mypy.cfg"
306+
)
300307
)
301308
return str(file)
302309

0 commit comments

Comments
 (0)