rhysd / vim-grammarous

A powerful grammar checker for Vim using LanguageTool.
1.1k stars 41 forks source link

Python comments ignored #47

Open stefanthorpe opened 7 years ago

stefanthorpe commented 7 years ago

If I run GrammarCheck --comments-only against the following python example:

def myfunction():
    """It doesn't works for multi line python."""

    # I doesn't work for single line comments.
    pass

The first mistakes are ignored. They are both picked up if I remove '--comments-only' but so is all the code.

I get the same result if I use in .vimrc:

let g:grammarous#default_comments_only_filetypes = {
            \ '*' : 1, 'help' : 0, 'markdown' : 0,
            \ }
rhysd commented 7 years ago

""" ... """ is not a comment actually. It's multi-line string literal. So Vim cannot detect it as comment from its syntax only. It is an expected behavior.