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

ValueError: Invalid starting width 88 #68

Closed
nemesifier opened this issue Jul 26, 2024 · 7 comments · Fixed by #71
Closed

ValueError: Invalid starting width 88 #68

nemesifier opened this issue Jul 26, 2024 · 7 comments · Fixed by #71

Comments

@nemesifier
Copy link
Contributor

Trying to run the latest version on this README: https://github.com/openwisp/openwisp-utils/blob/master/README.rst

I see this error:

docstrfmt --check -v README.rst 
ValueError: Invalid starting width 88
Failed to format '/home/nemesis/Code/openwisp/openwisp-utils/README.rst'
1 file were checked.
Done, but 1 error occurred ❌💥❌

I don't understand exactly what's going on.
It seems there's one line which triggers this.
Sometimes errors pop up but there's no indication of what line is causing them.

Funny thing is that removing the --check option allows the file to be reformatted successfully.

@LilSpazJoekp
Copy link
Owner

It does not like the nested table. This is a case I hadn't considered.

@LilSpazJoekp
Copy link
Owner

Try increasing the width or manually edit the nested table to better fit. I'll leave this open because it should be fixed but this is the first case I've seen a nested table and it should theoretically work but it'll need some special handleing. Unlike merged rows, I don't want to not support this use case.

@LilSpazJoekp
Copy link
Owner

Yeah, I think nested tables won't be easy to support. Docstrfmt has an auto sizing algorithm that doesn't work with nested tables either. I recommend switching many of your tables to a field list like this:

:attribute_1 str: Description for attribute 1.

:attribute_2 str: Description for attribute 2

:attribute_3 str: Description for attribute 3

This will also allow for your attribute tables to be more fluid and formatted in a format that is easier to maintain and edit.

@nemesifier
Copy link
Contributor Author

@LilSpazJoekp at the moment I would be happy with getting a more informative error message. Can we make it spit out at which line is failing?

@LilSpazJoekp
Copy link
Owner

@LilSpazJoekp
Copy link
Owner

Oh I misread your comment. Let me see if I that is avaliable at the point of failure.

@LilSpazJoekp
Copy link
Owner

Disregard literally everything I just said. I was able to fix it to support nested tables. Will release a fix for it soon.

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

Successfully merging a pull request may close this issue.

2 participants