Skip to content

Commit

Permalink
closes #15
Browse files Browse the repository at this point in the history
  • Loading branch information
Richardk2n committed Aug 15, 2021
1 parent a780119 commit 12cdaa1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pylsp_mypy/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.1"
__version__ = "0.5.2"
21 changes: 14 additions & 7 deletions pylsp_mypy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from typing import Optional, Dict, Any, IO, List
import atexit
import collections
import warnings

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

Expand Down Expand Up @@ -121,13 +122,17 @@ def pylsp_lint(
settings = config.plugin_settings("pylsp_mypy")
oldSettings1 = config.plugin_settings("mypy-ls")
if oldSettings1 != {}:
raise DeprecationWarning(
"Your configuration uses the namespace mypy-ls, this should be changed to pylsp_mypy"
warnings.warn(
DeprecationWarning(
"Your configuration uses the namespace mypy-ls, this should be changed to pylsp_mypy"
)
)
oldSettings2 = config.plugin_settings("mypy_ls")
if oldSettings2 != {}:
raise DeprecationWarning(
"Your configuration uses the namespace mypy_ls, this should be changed to pylsp_mypy"
warnings.warn(
DeprecationWarning(
"Your configuration uses the namespace mypy_ls, this should be changed to pylsp_mypy"
)
)
if settings == {}:
settings = oldSettings1
Expand Down Expand Up @@ -294,9 +299,11 @@ def findConfigFile(path: str, names: List[str]) -> Optional[str]:
file = parent.joinpath(name)
if file.is_file():
if file.name in ["mypy-ls.cfg", "mypy_ls.cfg"]:
raise DeprecationWarning(
f"{str(file)}: {file.name} is no longer supported, you should rename your "
"config file to pylsp-mypy.cfg"
warnings.warn(
DeprecationWarning(
f"{str(file)}: {file.name} is no longer supported, you should rename your "
"config file to pylsp-mypy.cfg"
)
)
return str(file)

Expand Down

0 comments on commit 12cdaa1

Please sign in to comment.