Description
#8811 added initial support for formatting doctest code snippets in docstrings, but it does have some silent behavior that should probably be louder. For example, if it detects a code snippet that is invalid Python, then it will silently skip the code snippet. Another example is a bit more pathological, but it is possible for the code snippet formatter to generate invalid Python in some case (as a result of nested triple quoted strings in some cases). In this case, we detect it and bail out of reformatting the code snippet. Ideally, we would emit a warning about this too, although this is arguably more of a bug in the current implementation.
This was brought up in review, and it was suggested that perhaps we split the warning/logging infrastructure out from the linter and use it in the formatter.