You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When checking docstrings the /scripts/validate_docstrings.py script tells which PEP8 violations have occurred in the examples, but not where. It would be helpful if the script also gave the line numbers of violations (as when running flake8 from the command line).
The text was updated successfully, but these errors were encountered:
This looks to be intentional; the validate_pep8 function includes this:
# We need this to avoid flake8 printing the names of the files to
# the standard output
application.formatter.write = lambda line, source: None
application.report()
The problem on implementing this is that we don't know the lines. The approach to validate PEP-8 in the docstrings is to move all the code to a temporary file, and then run flake8 on that file.
We can implement an algorithm that maps the lines in the validated file, to the lines in the source code, but I don't think it's trivial.
If I'm not wrong, flake8 gives us the content of the failing lines, or we can get them from the temporary file with the line numbers reported by flake8. May be reporting the content of the failing lines would be good enough?
Yes, even the lines that are failing will help to debug quickly. The current method I follow now is to comment out examples one after another to land upon the one that's causing the error and copy paste it to a python file to debug.
When checking docstrings the
/scripts/validate_docstrings.py
script tells which PEP8 violations have occurred in the examples, but not where. It would be helpful if the script also gave the line numbers of violations (as when runningflake8
from the command line).The text was updated successfully, but these errors were encountered: