Skip to content

Commit 760447b

Browse files
committed
Support pycodestyle indent-size option
1 parent 7b98f9f commit 760447b

File tree

6 files changed

+17
-0
lines changed

6 files changed

+17
-0
lines changed

Diff for: CONFIGURATION.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This server can be configured using `workspace/didChangeConfiguration` method. E
1212
| `pylsp.plugins.flake8.hangClosing` | `boolean` | Hang closing bracket instead of matching indentation of opening bracket's line. | `null` |
1313
| `pylsp.plugins.flake8.ignore` | `array` | List of errors and warnings to ignore (or skip). | `null` |
1414
| `pylsp.plugins.flake8.maxLineLength` | `integer` | Maximum allowed line length for the entirety of this run. | `null` |
15+
| `pylsp.plugins.flake8.indentSize` | `integer` | Set indentation spaces. | `null` |
1516
| `pylsp.plugins.flake8.perFileIgnores` | `array` | A pairing of filenames and violation codes that defines which violations to ignore in a particular file, for example: `["file_path.py:W305,W304"]`). | `null` |
1617
| `pylsp.plugins.flake8.select` | `array` | List of errors and warnings to enable. | `null` |
1718
| `pylsp.plugins.jedi.extra_paths` | `array` | Define extra paths for jedi.Script. | `[]` |
@@ -44,6 +45,7 @@ This server can be configured using `workspace/didChangeConfiguration` method. E
4445
| `pylsp.plugins.pycodestyle.ignore` | `array` of unique `string` items | Ignore errors and warnings | `null` |
4546
| `pylsp.plugins.pycodestyle.hangClosing` | `boolean` | Hang closing bracket instead of matching indentation of opening bracket's line. | `null` |
4647
| `pylsp.plugins.pycodestyle.maxLineLength` | `number` | Set maximum allowed line length. | `null` |
48+
| `pylsp.plugins.pycodestyle.indentSize` | `integer` | Set indentation spaces. | `null` |
4749
| `pylsp.plugins.pydocstyle.enabled` | `boolean` | Enable or disable the plugin. | `false` |
4850
| `pylsp.plugins.pydocstyle.convention` | `string` | Choose the basic list of checked errors by specifying an existing convention. | `null` |
4951
| `pylsp.plugins.pydocstyle.addIgnore` | `array` of unique `string` items | Ignore errors and warnings in addition to the specified convention. | `null` |

Diff for: pylsp/config/flake8_conf.py

+2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@
2020
('hang-closing', 'plugins.pycodestyle.hangClosing', bool),
2121
('ignore', 'plugins.pycodestyle.ignore', list),
2222
('max-line-length', 'plugins.pycodestyle.maxLineLength', int),
23+
('indent-size', 'plugins.pycodestyle.indentSize', int),
2324
('select', 'plugins.pycodestyle.select', list),
2425
# flake8
2526
('exclude', 'plugins.flake8.exclude', list),
2627
('filename', 'plugins.flake8.filename', list),
2728
('hang-closing', 'plugins.flake8.hangClosing', bool),
2829
('ignore', 'plugins.flake8.ignore', list),
2930
('max-line-length', 'plugins.flake8.maxLineLength', int),
31+
('indent-size', 'plugins.flake8.indentSize', int),
3032
('select', 'plugins.flake8.select', list),
3133
('per-file-ignores', 'plugins.flake8.perFileIgnores', list),
3234
]

Diff for: pylsp/config/pycodestyle_conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
('hang-closing', 'plugins.pycodestyle.hangClosing', bool),
1717
('ignore', 'plugins.pycodestyle.ignore', list),
1818
('max-line-length', 'plugins.pycodestyle.maxLineLength', int),
19+
('indent-size', 'plugins.pycodestyle.indentSize', int),
1920
('select', 'plugins.pycodestyle.select', list),
2021
('aggressive', 'plugins.pycodestyle.aggressive', int),
2122
]

Diff for: pylsp/config/schema.json

+10
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@
5454
"default": null,
5555
"description": "Maximum allowed line length for the entirety of this run."
5656
},
57+
"pylsp.plugins.flake8.indentSize": {
58+
"type": "integer",
59+
"default": null,
60+
"description": "Set indentation spaces."
61+
},
5762
"pylsp.plugins.flake8.perFileIgnores": {
5863
"type": "array",
5964
"default": null,
@@ -237,6 +242,11 @@
237242
"default": null,
238243
"description": "Set maximum allowed line length."
239244
},
245+
"pylsp.plugins.pycodestyle.indentSize": {
246+
"type": "integer",
247+
"default": null,
248+
"description": "Set indentation spaces."
249+
},
240250
"pylsp.plugins.pydocstyle.enabled": {
241251
"type": "boolean",
242252
"default": false,

Diff for: pylsp/plugins/flake8_lint.py

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def pylsp_lint(workspace, document):
4343
'hang-closing': settings.get('hangClosing'),
4444
'ignore': ignores or None,
4545
'max-line-length': settings.get('maxLineLength'),
46+
'indent-size': settings.get('indentSize'),
4647
'select': settings.get('select'),
4748
}
4849

Diff for: pylsp/plugins/pycodestyle_lint.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def pylsp_lint(workspace, document):
3232
'hang_closing': settings.get('hangClosing'),
3333
'ignore': settings.get('ignore'),
3434
'max_line_length': settings.get('maxLineLength'),
35+
'indent_size': settings.get('indentSize'),
3536
'select': settings.get('select'),
3637
}
3738
kwargs = {k: v for k, v in opts.items() if v}

0 commit comments

Comments
 (0)