sco1/flake8-annotations

Wrong column for ANN201

roym899 opened this issue · 1 comments

Describe the bug
ANN201 (probably the other ANN20... too, but I haven't tested them) is reported in the column right after def my_fun():. This can create problems (at least for coc.nvim) since that column (normally) doesn't exist.

I would expect it to report it at the closing bracket ) or at :.

To Reproduce
Minimal code example to reproduce the behavior:

"""ANN201 problem."""


def some_function():
    """Simple function."""
    pass

Results:

test.py:4:21: ANN201 Missing return type annotation for public function

(column 19 would be ), column 20 would be :)

Version Information

$ flake8 --version
3.8.4 (flake8-annotations: 2.6.1, flake8-docstrings: 1.5.0, pydocstyle: 5.1.1,
mccabe: 0.6.1, pycodestyle: 2.6.0, pyflakes: 2.2.0) CPython 3.7.5 on Linux
$ python -V
Python 3.7.5
sco1 commented

Thanks for this, I think it makes sense. Appreciate the PR, I'll try to get it patched sometime this week.