|
19 | 19 | from typing import Optional, Dict, Any, IO, List
|
20 | 20 | import atexit
|
21 | 21 | import collections
|
| 22 | +import warnings |
22 | 23 |
|
23 | 24 | line_pattern: str = r"((?:^[a-z]:)?[^:]+):(?:(\d+):)?(?:(\d+):)? (\w+): (.*)"
|
24 | 25 |
|
@@ -121,13 +122,17 @@ def pylsp_lint(
|
121 | 122 | settings = config.plugin_settings("pylsp_mypy")
|
122 | 123 | oldSettings1 = config.plugin_settings("mypy-ls")
|
123 | 124 | 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 | + ) |
126 | 129 | )
|
127 | 130 | oldSettings2 = config.plugin_settings("mypy_ls")
|
128 | 131 | 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 | + ) |
131 | 136 | )
|
132 | 137 | if settings == {}:
|
133 | 138 | settings = oldSettings1
|
@@ -294,9 +299,11 @@ def findConfigFile(path: str, names: List[str]) -> Optional[str]:
|
294 | 299 | file = parent.joinpath(name)
|
295 | 300 | if file.is_file():
|
296 | 301 | 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 | + ) |
300 | 307 | )
|
301 | 308 | return str(file)
|
302 | 309 |
|
|
0 commit comments