Fixed parsing of pydocstyle errors

ale#Escape function seems to prepend and append ' to the file name, which
are not present in the pydocstyle output. Having the parsing regexp match
the file name was overkill anyway, since there is an obvious 1:1
correspondence between the buffer number and the (potential) errors
reported by pydocstyle.
This commit is contained in:
Pablo Acosta-Serafini
2019-01-14 20:36:14 -05:00
parent a50e049e74
commit 86af4be0d0
2 changed files with 4 additions and 5 deletions

View File

@@ -33,8 +33,7 @@ function! ale_linters#python#pydocstyle#Handle(buffer, lines) abort
" Matches patterns like the following:
" mydir/myfile.py:33 in public function `myfunction`:
" DXXX: Error description
let l:fname = ale#Escape(fnamemodify(bufname(a:buffer), ':p:t'))
let l:line1_pattern = '\v^' . l:fname . ':\s*(\d+)\s+.*$'
let l:line1_pattern = '\v^.*:\s*(\d+)\s+.*$'
let l:line2_pattern = '\v^.*([a-zA-Z]\d+):\s*(.*)$'
let l:output = []