Skip to content

Commit

Permalink
Add extendSelect option to flake8 plugin (#559)
Browse files Browse the repository at this point in the history
Co-authored-by: Saúl Nogueras <susensio@nuc>
  • Loading branch information
Susensio and Saúl Nogueras authored Jul 24, 2024
1 parent a02339d commit cf3cea1
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 cf3cea1

Please sign in to comment.