8000 Replace pep8 with pycodestyle · python-mode/python-mode@a87f789 · GitHub
[go: up one dir, main page]

Skip to content

Commit a87f789

Browse files
committed
Replace pep8 with pycodestyle
For more info see: #1170 (comment)
1 parent a4731b4 commit a87f789

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

doc/pymode.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ Manually set breakpoint command (leave empty for automatic detection)
293293
3. Code checking ~
294294
*pymode-lint*
295295

296-
Pymode supports `pylint`, `pep257`, `pep8`, `pyflakes`, `mccabe` code
296+
Pymode supports `pylint`, `pep257`, `pycodestyle`, `pyflakes`, `mccabe` code
297297
checkers. You could run several similar checkers.
298298

299299
Pymode uses Pylama library for code checking. Many options like skip
@@ -330,9 +330,9 @@ Show error message if cursor placed at the error line *'g:pymode_lint_message'
330330
331331
Default code checkers (you could set several) *'g:pymode_lint_checkers'*
332332
>
333-
let g:pymode_lint_checkers = ['pyflakes', 'pep8', 'mccabe']
333+
let g:pymode_lint_checkers = ['pyflakes', 'pycodestyle', 'mccabe']
334334
335-
Values may be chosen from: `pylint`, `pep8`, `mccabe`, `pep257`, `pyflakes`.
335+
Values may be chosen from: `pylint`, `pycodestyle`, `mccabe`, `pep257`, `pyflakes`.
336336

337337
Skip errors and warnings *'g:pymode_lint_ignore'*
338338
E.g. ["W", "E2"] (Skip all Warnings and the Errors starting with E2) etc.
@@ -376,9 +376,9 @@ Definitions for |signs|
376376

377377
Pymode has the ability to set code checkers options from pymode variables:
378378

379-
Set PEP8 options *'g:pymode_lint_options_pep8'*
379+
Set PEP8 options *'g:pymode_lint_options_pycodestyle'*
380380
>
381-
let g:pymode_lint_options_pep8 =
381+
let g:pymode_lint_options_pycodestyle =
382382
\ {'max_line_length': g:pymode_options_max_line_length}
383383
384384
See https://pep8.readthedocs.org/en/1.4.6/intro.html#configuration for more

plugin/pymode.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ call pymode#default("g:pymode_lint_on_fly", 0)
122122
" Show message about error in command line
123123
call pymode#default("g:pymode_lint_message", 1)
124124

125-
" Choices are: pylint, pyflakes, pep8, mccabe and pep257
126-
call pymode#default("g:pymode_lint_checkers", ['pyflakes', 'pep8', 'mccabe'])
125+
" Choices are: pylint, pyflakes, pycodestyle, mccabe and pep257
126+
call pymode#default("g:pymode_lint_checkers", ['pyflakes', 'pycodestyle', 'mccabe'])
127127

128128
" Skip errors and warnings (e.g. E4,W)
129129
call pymode#default("g:pymode_lint_ignore", [])
@@ -152,8 +152,8 @@ call pymode#default("g:pymode_lint_info_symbol", "II")
152152
call pymode#default("g:pymode_lint_pyflakes_symbol", "FF")
153153

154154
" Code checkers options
155-
" TODO: check if most adequate name name is pep8 or pycodestyle.
156-
call pymode#default("g:pymode_lint_options_pep8",
155+
" TODO: check if most adequate name name is pycodestyle.
156+
call pymode#default("g:pymode_lint_options_pycodestyle",
157157
\ {'max_line_length': g:pymode_options_max_line_length})
158158

159159
call pymode#default("g:pymode_lint_options_pylint",

pymode/lint.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ def code_check():
4242
raise ValueError('g:pymode_lint_select should have a list type')
4343
else:
4444
select = env.var('g:pymode_lint_select')
45+
if 'pep8' in linters:
46+
# TODO: Add a user visible deprecation warning here
47+
env.message('pep8 linter is deprecated, please use pycodestyle.')
48+
linters.remove('pep8')
49+
linters.append('pycodestyle')
50+
4551
options = parse_options(
4652
linters=linters, force=1,
4753
ignore=ignore,

tests/utils/pymoderc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let g:pymode_lint_on_write = 1
2525
let g:pymode_lint_unmodified = 0
2626
let g:pymode_lint_on_fly = 0
2727
let g:pymode_lint_message = 1
28-
let g:pymode_lint_checkers = ['pyflakes', 'pep8', 'mccabe']
28+
let g:pymode_lint_checkers = ['pyflakes', 'pycodestyle', 'mccabe']
2929
let g:pymode_lint_ignore = ["E501", "W",]
3030
let g:pymode_lint_select = ["E501", "W0011", "W430"]
3131
let g:pymode_lint_sort = []
@@ -37,7 +37,7 @@ let g:pymode_lint_visual_symbol = 'RR'
3737
let g:pymode_lint_error_symbol = 'EE'
3838
let g:pymode_lint_info_symbol = 'II'
3939
let g:pymode_lint_pyflakes_symbol = 'FF'
40-
let g:pymode_lint_options_pep8 =
40+
let g:pymode_lint_options_pycodestyle =
4141
\ {'max_line_length': g:pymode_options_max_line_length}
4242
let g:pymode_lint_options_pyflakes = { 'builtins': '_' }
4343
let g:pymode_lint_options_mccabe = { 'complexity': 12 }

0 commit comments

Comments
 (0)
0