Closed chew-z closed 7 years ago
I have fixed the proselint bug. The spaces in the filename weren't being handled correctly.
For the vale linter, you'll need to write a new function for parsing the errors, or you'll have to see if you can pass some options to vale
to make it output errors in a format that can be parsed by the ale#handlers#unix#HandleAsWarning
function.
vale has the ability to change output format with --output=line
.
Now it is working beautifully. Thank you... :+1:
Plugin content below. I will also try with --ext='.md' option of vale.
call ale#linter#Define('markdown', {
\ 'name': 'vale',
\ 'executable': 'vale',
\ 'command': "vale --output=line %t",
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})
Cool. Feel free to open a pull request for vale
whenever.
Hi @chew-z & @w0rp ,
I am not sure what I did wrong in my settings. But I can't have ale display any linting error when processing markdown file via vale. Here's outputs of some of the files.
ALEInfo:
Current Filetype: markdown
Available Linters: ['alex', 'languagetool', 'markdownlint', 'mdl', 'proselint', 'redpen', 'remark_lint', 'textlint', 'vale', 'writegood']
Linter Aliases:
'remark_lint' -> ['remark-lint']
'writegood' -> ['write-good']
Enabled Linters: ['vale']
Suggested Fixers:
'prettier' - Apply prettier to a file.
'remark-lint' - Fix markdown files with remark-lint
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'textlint' - Fix text files with textlint --fix
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
Linter Variables:
let g:ale_markdown_remark_lint_executable = 'remark'
let g:ale_markdown_remark_lint_options = ''
let g:ale_markdown_remark_lint_use_global = 0
Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {'markdown': ['vale'], 'text': ['vale']}
let g:ale_linters_explicit = 0
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '[%linter%] %s [%severity%]'
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - success) vale
(finished - exit code 0) ['/bin/zsh', '-c', 'vale --output=JSON ''/var/folders/kx/3dgbmvjx14n9nk7f6w0px7l80000gn/T/v8nPkws/2/README.md''']
<<<OUTPUT STARTS>>>
{}
<<<OUTPUT ENDS>>>
.vimrc:
let g:ale_linters = {'markdown': ['vale'], 'text': ['vale']}
let g:airline#extensions#ale#enabled = 1
let g:ale_fix_on_save = 1
let g:ale_lint_on_enter = 1
vale --config "/Users/yohanes.wijaya/.config/vale/.vale.ini"
README.md
1:3 suggestion 'vale-boilerplate' should use Microsoft.Headings
sentence-style capitalization.
1:3 warning 'vale-boilerplate' should use Google.Headings
sentence-style capitalization.
3:6 suggestion Try to avoid using 'is'. write-good.E-Prime
7:11 suggestion 'is optimised' looks like Microsoft.Passive
passive voice.
7:11 warning 'is optimised' may be passive write-good.Passive
voice. Use active voice if you
can.
7:11 suggestion In general, use active voice Google.Passive
instead of passive voice ('is
optimised').
7:11 suggestion Try to avoid using 'is'. write-good.E-Prime
7:38 warning 'however' is too wordy. write-good.TooWordy
7:47 warning Try to avoid using Google.We
first-person plural like 'we'.
7:47 warning Try to avoid using Microsoft.We
first-person plural like 'we'.
12:6 suggestion Try to avoid using 'is'. write-good.E-Prime
16:17 suggestion Try to avoid using 'is'. write-good.E-Prime
16:20 warning Consider removing 'extremely'. Microsoft.Adverbs
16:20 warning 'extremely' is a weasel word! write-good.Weasel
18:50 warning Avoid using 'will'. Google.Will
18:120 warning 'However' is too wordy. write-good.TooWordy
18:132 warning Try to avoid using Google.We
first-person plural like 'we'.
18:132 warning Try to avoid using Microsoft.We
first-person plural like 'we'.
18:173 warning Avoid using 'will'. Google.Will
20:17 suggestion Try to avoid using 'is'. write-good.E-Prime
30:6 suggestion Try to avoid using 'is'. write-good.E-Prime
30:6 warning 'is' is repeated! write-good.Illusions
34:87 suggestion Consider using 'has' instead Microsoft.ComplexWords
of 'contains'.
✖ 0 errors, 13 warnings and 10 suggestions in 1 file.
vale.vim linter in /ale/ale_linters/markdown
" Author: chew-z https://github.com/chew-z
" Description: vale for Markdown files
call ale#linter#Define('markdown', {
\ 'name': 'vale',
\ 'executable': 'vale',
\ 'command': 'vale --output=JSON %t',
\ 'callback': 'ale#handlers#vale#Handle',
\})
I am trying to use proselint and also experimenting with vale linter for markdown and text files but no joy.
There are obvious warnings in my text but ALE is ignoring them and showing that everything is OK.
My ALEInfo
.vimrc
output of
:! proselint "%"
output of
:! vale "%"
vale.vim linter in
/ale/ale_linters/markdown