Skip to content

Commit

Permalink
TOML dicts are formatted {"tool" {"ruff": {..}}}
Browse files Browse the repository at this point in the history
And not as {"tool.ruff": {..}}
  • Loading branch information
maerteijn committed Sep 24, 2023
1 parent 926f50d commit f88df2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pylsp_ruff/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,10 @@ def load_settings(workspace: Workspace, document_path: str) -> PluginSettings:
try:
with open(pyproject_file[0], "rb") as f:
toml_dict = tomllib.load(f)
if "tool.ruff" in toml_dict:
config_in_pyproject = True

if "tool" in toml_dict and "ruff" in toml_dict["tool"]:
config_in_pyproject = True

except tomllib.TOMLDecodeError:
log.warn("Error while parsing toml file, ignoring config.")

Expand Down

0 comments on commit f88df2a

Please sign in to comment.