vim-grammarous icon indicating copy to clipboard operation
vim-grammarous copied to clipboard

Python comments ignored

Open stefanthorpe opened this issue 7 years ago • 1 comments

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,
            \ }

stefanthorpe avatar Sep 04 '17 22:09 stefanthorpe

""" ... """ 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.

rhysd avatar Sep 05 '17 04:09 rhysd