dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.38k stars 1.42k forks source link

Lint error is not displayed with the latest markdownlint-cli #2965

Closed yysushi closed 3 years ago

yysushi commented 4 years ago

Information

VIM version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Dec 12 2019 16:51:54)
macOS version

Operating System:

Darwin 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec 1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64 x86_64 i386

What went wrong

Lint error by markdownlint is not displayed.

Reproducing the bug

  1. Install the latest markdownlint-cli.
    
    koketani:tmp$ npm install -g markdownlint-cli
    (snipped)

koketani:tmp$ npm list -g markdownlint-cli /Users/y-tsuji/.nvm/versions/node/v12.14.0/lib └── markdownlint-cli@0.21.0


2. Write broken markdown file.
```shell-session
koketani:tmp$ cat hoge.md
a

koketani:tmp$ markdownlint hoge.md
hoge.md:1 MD041/first-line-heading/first-line-h1 First line in file should be a top level heading [Context: "a"]
  1. Then you got the issue. (Expecting the error is displayed, but not...)

: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: ['markdownlint']
 Suggested Fixers: 
  'prettier' - Apply prettier to a file.
  '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 = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {'go': ['gofmt'], 'javascript': ['eslint'], 'json': ['prettier'], 'html': ['prettier'], '*': ['remove_trailing_lines', 'trim_whitespace'], 'cpp': ['clang-format']}
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 = 1000
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 = {'vim': ['vint'], 'typescript': ['tslint'], 'go': ['golint', 'govet'], 'javascript': ['eslint'], 'python': ['flake8'], 'json': ['jsonlint'], 'sh': ['shellcheck'], 'html': ['tidy'], 'cpp': ['clang'], 'yaml': ['yamllint'], 'markdown': ['markdownlint']}
let g:ale_linters_explicit = 1
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
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) markdownlint
(finished - exit code 1) ['/bin/bash', '-c', 'markdownlint ''/private/tmp/hoge.md''']

<<<OUTPUT STARTS>>>
/private/tmp/hoge.md:1 MD041/first-line-heading/first-line-h1 First line in file should be a top level heading [Context: "a"]
<<<OUTPUT ENDS>>>
yysushi commented 4 years ago

I suppose that this issue is by markdownlint-cli's change.

This brings an inconsistency with expected pattern by ale.

davidsierradz commented 4 years ago

Fixed already in #2895 or #2926

yysushi commented 4 years ago

@davidsierradz Thanks! :) I didn't notice that... Let me close the issue as duplicate.

davidsierradz commented 4 years ago

I think you should keep this issue open until a PR gets merged.

yysushi commented 4 years ago

Oh.. I see..

yanqd0 commented 4 years ago

I find markdownlint is missing in :help ale-markdown, but still in supported-tools.md. It is confusing.

Is there anyone working on this?

bo5o commented 4 years ago

I can confirm that https://github.com/dense-analysis/ale/pull/2926 fixes the issue.

EDIT: There are remaining issues with correctly parsing line numbers (e.g. for MD013 - Line Length)