Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error reports don't contain information about the error #806

Open
RunDevelopment opened this issue Jul 8, 2024 · 2 comments
Open

Comments

@RunDevelopment
Copy link

Currently, syntax errors in doc strings are reported like this:

Generating objects inventory at docs/objects.inv
these 2 objects' docstrings contain syntax errors:
    spandrel.architectures.GRL.__arch.grl.GRL
    spandrel.architectures.GRL.__arch.grl.TransformerStage

This is not enough information. It says where an error happened, but not what the error is.

In my case, I have 100 lines in a single doc comment and no idea what the problem is. The page renders correctly, it's just objects.inv that's causing my CI to fail. I'm using the google docformat, but the same problem occurs with restructured text as well.

Please show the error message and ideally the line and column of the syntax error as well.

I would like the above report to look like something like this:

Generating objects inventory at docs/objects.inv
these 2 objects' docstrings contain syntax errors:
    spandrel.architectures.GRL.__arch.grl.GRL
        L16:4  Invalid character '*' or whatever, idk the actual error
    spandrel.architectures.GRL.__arch.grl.TransformerStage
        L94  Unexpected list in the middle of whatever

Running pydoctor -v does not give additional information about the above errors.

@tristanlatr
Copy link
Contributor

tristanlatr commented Jul 8, 2024

Hello @RunDevelopment thanks for your feature request.

For the short term, please look for bad docstring errors in the pydoctor output. This should point you towards the right line numbers. Also note that numpy and google docstring formats currently introduces a slight offset in the docstring line numbers because the text is preprocessed to be transformed into regular restructuredtext (#807 ).

@RunDevelopment
Copy link
Author

For the short term, please look for bad docstring errors in the pydoctor output.

Thank you! This has the error message 👍

I didn't find these until now, because I was searching for the documented class (e.g. spandrel.architectures.GRL.__arch.grl.GRL) as reported, but bad docstring errors log the file path. Maybe the qualified name of the docstring target should be logged as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants