8000 Add mccabe setting to flake8 (#63) · rookiecoder1st/python-lsp-server@2e3e4b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2e3e4b4

Browse files
authored
Add mccabe setting to flake8 (python-lsp#63)
1 parent bbb24b8 commit 2e3e4b4

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

CONFIGURATION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This server can be configured using the `workspace/didChangeConfiguration` metho
1212
| `pylsp.plugins.flake8.filename` | `string` | Only check for filenames matching the patterns in this list. | `null` |
1313
| `pylsp.plugins.flake8.hangClosing` | `boolean` | Hang closing bracket instead of matching indentation of opening bracket's line. | `null` |
1414
| `pylsp.plugins.flake8.ignore` | `array` of `string` items | List of errors and warnings to ignore (or skip). | `[]` |
15+
| `pylsp.plugins.flake8.maxComplexity` | `integer` | Maximum allowed complexity threshold. | `null` |
1516
| `pylsp.plugins.flake8.maxLineLength` | `integer` | Maximum allowed line length for the entirety of this run. | `null` |
1617
| `pylsp.plugins.flake8.indentSize` | `integer` | Set indentation spaces. | `null` |
1718
| `pylsp.plugins.flake8.perFileIgnores` | `array` of `string` items | A pairing of filenames and violation codes that defines which violations to ignore in a particular file, for example: `["file_path.py:W305,W304"]`). | `[]` |

pylsp/config/flake8_conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
('filename', 'plugins.flake8.filename', list),
2828
('hang-closing', 'plugins.flake8.hangClosing', bool),
2929
('ignore', 'plugins.flake8.ignore', list),
30+
('max-complexity', 'plugins.flake8.maxComplexity', int),
3031
('max-line-length', 'plugins.flake8.maxLineLength', int),
3132
('indent-size', 'plugins.flake8.indentSize', int),
3233
('select', 'plugins.flake8.select', list),

pylsp/config/schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
},
6161
"description": "List of errors and warnings to ignore (or skip)."
6262
},
63+
"pylsp.plugins.flake8.maxComplexity": {
64+
"type": "integer",
65+
"default": null,
66+
"description": "Maximum allowed complexity threshold."
67+
},
6368
"pylsp.plugins.flake8.maxLineLength": {
6469
"type": ["integer", "null"],
6570
"default": null,

pylsp/plugins/flake8_lint.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def pylsp_lint(workspace, document):
6161
'filename': settings.get('filename'),
6262
'hang-closing': settings.get('hangClosing'),
6363
'ignore': ignores or None,
64+
'max-complexity': settings.get('maxComplexity'),
6465
'max-line-length': settings.get('maxLineLength'),
6566
'indent-size': settings.get('indentSize'),
6667
'select': settings.get('select'),

0 commit comments

Comments
 (0)
0