Skip to content

Commit

Permalink
Add extend-select to flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Saúl Nogueras committed May 20, 2024
1 parent 4c0e99b commit 5d51bf7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This server can be configured using the `workspace/didChangeConfiguration` metho
| `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.extendSelect` | `array` of `string` items | List of errors and warnings to append to select 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 @@ -27,6 +27,7 @@
# flake8
("exclude", "plugins.flake8.exclude", list),
("extend-ignore", "plugins.flake8.extendIgnore", list),
("extend-select", "plugins.flake8.extendSelect", list),
("filename", "plugins.flake8.filename", list),
("hang-closing", "plugins.flake8.hangClosing", bool),
("ignore", "plugins.flake8.ignore", list),
Expand Down
10 changes: 9 additions & 1 deletion pylsp/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@
},
"description": "List of errors and warnings to append to ignore list."
},
"pylsp.plugins.flake8.extendSelect": {
"type": "array",
"default": [],
"items": {
"type": "string"
},
"description": "List of errors and warnings to append to select list."
},
"pylsp.plugins.flake8.executable": {
"type": "string",
"default": "flake8",
Expand Down Expand Up @@ -500,4 +508,4 @@
"description": "The name of the folder in which rope stores project configurations and data. Pass `null` for not using such a folder at all."
}
}
}
}
1 change: 1 addition & 0 deletions pylsp/plugins/flake8_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def pylsp_lint(workspace, document):
"config": settings.get("config"),
"exclude": settings.get("exclude"),
"extend-ignore": settings.get("extendIgnore"),
"extend-select": settings.get("extendSelect"),
"filename": settings.get("filename"),
"hang-closing": settings.get("hangClosing"),
"ignore": ignores or None,
Expand Down

0 comments on commit 5d51bf7

Please sign in to comment.