|
16 | 16 | import shutil
|
17 | 17 | import subprocess
|
18 | 18 | import tempfile
|
19 |
| -import warnings |
20 | 19 | from pathlib import Path
|
21 | 20 | from typing import IO, Any, Dict, List, Optional
|
22 | 21 |
|
@@ -147,17 +146,13 @@ def pylsp_lint(
|
147 | 146 | settings = config.plugin_settings("pylsp_mypy")
|
148 | 147 | oldSettings1 = config.plugin_settings("mypy-ls")
|
149 | 148 | 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" |
154 | 151 | )
|
155 | 152 | oldSettings2 = config.plugin_settings("mypy_ls")
|
156 | 153 | 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" |
161 | 156 | )
|
162 | 157 | if settings == {}:
|
163 | 158 | settings = oldSettings1
|
@@ -376,11 +371,9 @@ def findConfigFile(path: str, names: List[str]) -> Optional[str]:
|
376 | 371 | file = parent.joinpath(name)
|
377 | 372 | if file.is_file():
|
378 | 373 | 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." |
384 | 377 | )
|
385 | 378 | if file.name == "pyproject.toml":
|
386 | 379 | isPluginConfig = "pylsp-mypy.cfg" in names
|
|
0 commit comments