anentropic / python-waterloo

A cli tool to convert type annotations found in 'Google-style' docstrings into mypy py2 type comments (and from there into py3 type annotations).
2 stars 1 forks source link

TODO: parser leniency #7

Closed anentropic closed 4 years ago

anentropic commented 4 years ago

there are a couple of cases that are currently not parsed, or tests assume not parsed:

  1. blank line after section head

    Returns:
    
    <return type>: blah blah
  2. whitespace preceding : separator

    Args:
    user_id (int) : blah blah

I think it's possible and desirable to cope with these, e.g. for 1. the indentation signifies block membership