From 2373aed474fd821fa5d2fb6495a8f2957a8e0f04 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 18 Oct 2023 19:30:02 +1100 Subject: [PATCH 1/3] Remove flake8 from auto-disable dict flake8 plugin is disabled by default. If it's been enabled in the pylsp configuration then it's not possible for another plugin to disable it. The other four plugins (pycodestyle, pyflakes, mccabe, pyls_isort) are all enabled by default so the ruff plugin can disable them, provided they're not explicitly enabled in the configuration. Closes #46 --- README.md | 2 +- pylsp_ruff/plugin.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aa1c2c3..2b393b5 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ There also exists an [AUR package](https://aur.archlinux.org/packages/python-lsp # Usage -This plugin will disable `flake8`, `pycodestyle`, `pyflakes`, `mccabe` and `pyls_isort` by default. +This plugin will disable `pycodestyle`, `pyflakes`, `mccabe` and `pyls_isort` by default, unless they are explicitly enabled in the client configuration. When enabled, all linting diagnostics will be provided by `ruff`. Sorting of the imports through `ruff` when formatting is enabled by default. The list of code fixes can be changed via the `pylsp.plugins.ruff.format` option. diff --git a/pylsp_ruff/plugin.py b/pylsp_ruff/plugin.py index c9c62e1..2342b99 100644 --- a/pylsp_ruff/plugin.py +++ b/pylsp_ruff/plugin.py @@ -64,12 +64,12 @@ @hookimpl def pylsp_settings(): log.debug("Initializing pylsp_ruff") - # this plugin disables flake8, mccabe, and pycodestyle by default + # This plugin disables some enabled-by-default plugins that duplicate Ruff + # functionality settings = { "plugins": { "ruff": PluginSettings(), "pyflakes": {"enabled": False}, - "flake8": {"enabled": False}, "mccabe": {"enabled": False}, "pycodestyle": {"enabled": False}, "pyls_isort": {"enabled": False}, From 34bd4d7991c06329f6a894a8c273bd8b3bb6b569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Ho=C3=9Fbach?= Date: Wed, 18 Oct 2023 09:56:54 +0200 Subject: [PATCH 2/3] restrict ruff to <0.1.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bd52059..21e5074 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ readme = "README.md" requires-python = ">=3.7" license = {text = "MIT"} dependencies = [ - "ruff>=0.0.267", + "ruff>=0.0.267,<0.1.0", "python-lsp-server", "lsprotocol>=2022.0.0a1", "tomli>=1.1.0; python_version < '3.11'", From 6a9a2ff1042fb109626614a8d0fddbfdf9fbd325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Ho=C3=9Fbach?= Date: Wed, 18 Oct 2023 10:38:08 +0200 Subject: [PATCH 3/3] bump to v1.5.3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 21e5074..f96f12e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "python-lsp-ruff" authors = [ {name = "Julian Hossbach", email = "julian.hossbach@gmx.de"} ] -version = "1.5.2" +version = "1.5.3" description = "Ruff linting plugin for pylsp" readme = "README.md" requires-python = ">=3.7"