Fix #536 - Implement linter problem type re-mapping

This commit is contained in:
w0rp
2017-06-14 17:59:13 +01:00
parent c2258e3684
commit f814be45b1
4 changed files with 180 additions and 0 deletions

View File

@@ -745,6 +745,35 @@ g:ale_sign_warning *g:ale_sign_warning*
The sign for warnings in the sign gutter.
g:ale_type_map *g:ale_type_map*
*b:ale_type_map*
Type: |Dictionary|
Default: `{}`
This option can be set re-map problem types for linters. Each key in
the |Dictionary| should be the name of a linter, and each value must be
a |Dictionary| mapping error types from one type to another. The
following types are supported:
`'E'` - `{'type': 'E'}`
`'ES'` - `{'type': 'E', 'sub_type': 'style'}`
`'W'` - `{'type': 'W'}`
`'WS'` - `{'type': 'W', 'sub_type': 'style'}`
`'I'` - `{'type': 'I'}`
For example, if you want to turn flake8 errors into warnings, you can do
the following: >
let g:ale_type_map = {'flake8', {'ES': 'WS', 'E': 'W'}}
<
If you wanted to turn style errors and warnings into regular errors and
warnings, you can use the following: >
let g:ale_type_map = {'flake8', {'ES': 'E', 'WS': 'W'}}
<
Type maps can be set per-buffer with `b:ale_type_map`.
g:ale_warn_about_trailing_whitespace *g:ale_warn_about_trailing_whitespace*
b:ale_warn_about_trailing_whitespace *b:ale_warn_about_trailing_whitespace*