html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/pull/7152#issuecomment-1287899447,https://api.github.com/repos/pydata/xarray/issues/7152,1287899447,IC_kwDOAMm_X85Mw8k3,14808389,2022-10-22T19:59:16Z,2022-10-22T19:59:48Z,MEMBER,"well, that's just it: there's no way to discriminate between docstrings and multi-line triple-quoted strings without parsing the python code (which is definitely out of scope), so `blackdoc` doesn't even attempt to. Instead, any line that begins with `>>> ` will be assumed to be doctest lines. So with that, the numbers mean: line 201, character 27.
When created that file we decided to skip the `generate_*` file, but because the file was renamed that rule does not work anymore. Could you update the `pre-commit` configuration?","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1403614394
https://github.com/pydata/xarray/pull/7152#issuecomment-1287825909,https://api.github.com/repos/pydata/xarray/issues/7152,1287825909,IC_kwDOAMm_X85Mwqn1,14808389,2022-10-22T15:21:44Z,2022-10-22T15:24:45Z,MEMBER,"> do you understand this blackdoc error?
so the reason is the position of the triple quotes: with
```python
def f():
""""""
>>> 1 + 2""""""
pass
```
the extracted line will become: `1 + 2""""""`, which when handed to `black` results in that error.
Technically, that's a bug (the triple quotes mark the end of the docstring), but one that is a bit tricky to fix: `blackdoc` is implemented using a line parser, which does not work too well if the transition happen somewhere within the line.
My guess is that it would have to start counting quotes which I've tried to avoid up until now since there's a lot of details to get right (see also keewis/blackdoc#145)
Edit: for now, I guess it would be fine to add something like `The closing quotes are not on their own line.` to the error message","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1403614394