From 9d45a24e613c4536b8fee25e566965d45b25ddeb Mon Sep 17 00:00:00 2001 From: UnkwUsr Date: Fri, 20 Oct 2023 22:40:18 +0300 Subject: [PATCH] feat(flake8): pass argument extendIgnore --- CONFIGURATION.md | 1 + pylsp/config/flake8_conf.py | 1 + pylsp/config/schema.json | 8 ++++++++ pylsp/plugins/flake8_lint.py | 1 + 4 files changed, 11 insertions(+) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index f2626e44..f88e425c 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -8,6 +8,7 @@ This server can be configured using the `workspace/didChangeConfiguration` metho | `pylsp.plugins.flake8.config` | `string` | Path to the config file that will be the authoritative config source. | `null` | | `pylsp.plugins.flake8.enabled` | `boolean` | Enable or disable the plugin. | `false` | | `pylsp.plugins.flake8.exclude` | `array` of `string` items | List of files or directories to exclude. | `[]` | +| `pylsp.plugins.flake8.extendIgnore` | `array` of `string` items | List of errors and warnings to append to ignore list. | `[]` | | `pylsp.plugins.flake8.executable` | `string` | Path to the flake8 executable. | `"flake8"` | | `pylsp.plugins.flake8.filename` | `string` | Only check for filenames matching the patterns in this list. | `null` | | `pylsp.plugins.flake8.hangClosing` | `boolean` | Hang closing bracket instead of matching indentation of opening bracket's line. | `null` | diff --git a/pylsp/config/flake8_conf.py b/pylsp/config/flake8_conf.py index 485945df..ca3b199c 100644 --- a/pylsp/config/flake8_conf.py +++ b/pylsp/config/flake8_conf.py @@ -24,6 +24,7 @@ ("select", "plugins.pycodestyle.select", list), # flake8 ("exclude", "plugins.flake8.exclude", list), + ("extend-ignore", "plugins.flake8.extendIgnore", list), ("filename", "plugins.flake8.filename", list), ("hang-closing", "plugins.flake8.hangClosing", bool), ("ignore", "plugins.flake8.ignore", list), diff --git a/pylsp/config/schema.json b/pylsp/config/schema.json index 4ac085d0..fbf7f014 100644 --- a/pylsp/config/schema.json +++ b/pylsp/config/schema.json @@ -37,6 +37,14 @@ }, "description": "List of files or directories to exclude." }, + "pylsp.plugins.flake8.extendIgnore": { + "type": "array", + "default": [], + "items": { + "type": "string" + }, + "description": "List of errors and warnings to append to ignore list." + }, "pylsp.plugins.flake8.executable": { "type": "string", "default": "flake8", diff --git a/pylsp/plugins/flake8_lint.py b/pylsp/plugins/flake8_lint.py index d31783bf..8d8d4c5f 100644 --- a/pylsp/plugins/flake8_lint.py +++ b/pylsp/plugins/flake8_lint.py @@ -58,6 +58,7 @@ def pylsp_lint(workspace, document): opts = { "config": settings.get("config"), "exclude": settings.get("exclude"), + "extend-ignore": settings.get("extendIgnore"), "filename": settings.get("filename"), "hang-closing": settings.get("hangClosing"), "ignore": ignores or None,