From 2373aed474fd821fa5d2fb6495a8f2957a8e0f04 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 18 Oct 2023 19:30:02 +1100 Subject: [PATCH] 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},