Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mccabe setting to flake8 #63

Merged
merged 5 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This server can be configured using the `workspace/didChangeConfiguration` metho
| `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` |
| `pylsp.plugins.flake8.ignore` | `array` of `string` items | List of errors and warnings to ignore (or skip). | `[]` |
| `pylsp.plugins.flake8.maxComplexity` | `integer` | Maximum allowed complexity threshold. | `null` |
| `pylsp.plugins.flake8.maxLineLength` | `integer` | Maximum allowed line length for the entirety of this run. | `null` |
| `pylsp.plugins.flake8.indentSize` | `integer` | Set indentation spaces. | `null` |
| `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"]`). | `[]` |
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 @@
('filename', 'plugins.flake8.filename', list),
('hang-closing', 'plugins.flake8.hangClosing', bool),
('ignore', 'plugins.flake8.ignore', list),
('max-complexity', 'plugins.flake8.maxComplexity', int),
('max-line-length', 'plugins.flake8.maxLineLength', int),
('indent-size', 'plugins.flake8.indentSize', int),
('select', 'plugins.flake8.select', list),
Expand Down
5 changes: 5 additions & 0 deletions pylsp/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
},
"description": "List of errors and warnings to ignore (or skip)."
},
"pylsp.plugins.flake8.maxComplexity": {
"type": "integer",
"default": null,
"description": "Maximum allowed complexity threshold."
},
"pylsp.plugins.flake8.maxLineLength": {
"type": ["integer", "null"],
"default": null,
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 @@ -61,6 +61,7 @@ def pylsp_lint(workspace, document):
'filename': settings.get('filename'),
'hang-closing': settings.get('hangClosing'),
'ignore': ignores or None,
'max-complexity': settings.get('maxComplexity'),
'max-line-length': settings.get('maxLineLength'),
'indent-size': settings.get('indentSize'),
'select': settings.get('select'),
Expand Down