Skip to content

Commit

Permalink
Pass argument extendIgnore to flake8 (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
UnkwUsr authored Oct 21, 2023
1 parent 1f415b5 commit 728929c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
1 change: 1 addition & 0 deletions pylsp/config/flake8_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
8 changes: 8 additions & 0 deletions pylsp/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions pylsp/plugins/flake8_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 728929c

Please sign in to comment.