Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config bugfixes #44

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pylsp_ruff/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +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
except tomllib.TOMLDecodeError:
log.warn("Error while parsing toml file, ignoring config.")
if "tool.ruff" in toml_dict:
config_in_pyproject = True

ruff_toml = find_parents(
workspace.root_path, document_path, ["ruff.toml", ".ruff.toml"]
Expand All @@ -581,7 +581,7 @@ def load_settings(workspace: Workspace, document_path: str) -> PluginSettings:
log.debug("Found existing configuration for ruff, skipping pylsp config.")
# Leave config to pyproject.toml
return PluginSettings(
enabled=plugin_settings.executable,
enabled=plugin_settings.enabled,
executable=plugin_settings.executable,
extend_ignore=plugin_settings.extend_ignore,
extend_select=plugin_settings.extend_select,
Expand Down
Loading