All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 Save g:ale_warn_about_trailing_whitespace
4 let g:ale_warn_about_trailing_whitespace = 1
6 runtime ale_linters/python/pydocstyle.vim
11 call ale#linter#Reset()
13 silent file something_else.py
20 " This is a multi-line description that should produce multiple errors to be
21 " tested by the handler
26 " if __name__ == '__main__':
29 " The command to generate the handler input is:
31 " $ python -m pydocstyle --verbose --source --explain sample.py
35 Execute(Basic pydocstyle warnings should be handled):
41 \ 'text': 'Missing docstring in public module',
48 \ 'text': '1 blank line required between summary line and description (found 0)',
55 \ 'text': 'First line should end with a period (not ''e'')',
62 \ 'text': 'First line should be in imperative mood; try rephrasing (found ''This'')',
67 \ ale_linters#python#pydocstyle#Handle(bufnr(''), [
68 \ 'Checking file ' . fnamemodify(bufname(bufnr('')), ':p') . '.',
69 \ './mydir/myfile.py:1 at module level:',
70 \ ' D100: Missing docstring in public module',
72 \ ' All modules should normally have docstrings. [...] all functions and',
73 \ ' classes exported by a module should also have docstrings. Public',
74 \ ' methods (including the __init__ constructor) should also have',
76 \ ' Note: Public (exported) definitions are either those with names listed',
77 \ ' in __all__ variable (if present), or those that do not start',
78 \ ' with a single underscore.',
80 \ ' 1: # 2: 3: s 4: a 5: m 6: p 7: l ...',
83 \ 'C:\mydir\myfile.py:4 in public function `main`:',
84 \ ' D205: 1 blank line required between summary line and description (found 0)',
86 \ ' Multi-line docstrings consist of a summary line just like a one-line',
87 \ ' docstring, followed by a blank line, followed by a more elaborate',
88 \ ' description. The summary line may be used by automatic indexing tools;',
89 \ ' it is important that it fits on one line and is separated from the',
90 \ ' rest of the docstring by a blank line.',
92 \ ' 3: d 4: e 5: f 6: 7: m 8: a 9: i ...',
95 \ 'myfile.py:4 in public function `main`:',
96 \ ' D400: First line should end with a period (not ''e'')',
98 \ ' The [first line of a] docstring is a phrase ending in a period.',
100 \ ' 3: d 4: e 5: f 6: 7: m 8: a 9: i ...',
103 \ ale#Escape(fnamemodify(bufname(bufnr('')), ':t')) . ':4 in public function `main`:',
104 \ ' D401: First line should be in imperative mood; try rephrasing (found ''This'')',
106 \ ' [Docstring] prescribes the function or method''s effect as a command:',
107 \ ' ("Do this", "Return that"), not as a description; e.g. don''t write',
108 \ ' "Returns the pathname ...".',
110 \ ' 3: d 4: e 5: f 6: 7: m 8: a 9: i ...',
113 Execute(Handler should handle empty output):
116 \ ale_linters#python#pydocstyle#Handle(bufnr(''), [])