Can we get rid of the "Consider using a block-scoped tag" warning?

65 views
Skip to first unread message

Volker Braun

unread,
Aug 3, 2023, 12:54:53 PM8/3/23
to sage-devel
The test output is full of "Warning: Consider using a block-scoped tag by inserting the line...", making it hard to see where the actual error is. 

Whats the purpose of this? Is somebody working on converting the magic comments? Should the warning be unconditionally removed? Can it at least be filtered out when running "/sage -t --all --long --only-errors"? Its --only-errors, not --only-errors-and-docstring-warnings ;)


Matthias Koeppe

unread,
Aug 3, 2023, 2:31:25 PM8/3/23
to sage-devel
On Thursday, August 3, 2023 at 9:54:53 AM UTC-7 Volker Braun wrote:
The test output is full of "Warning: Consider using a block-scoped tag by inserting the line...", making it hard to see where the actual error is. 

Whats the purpose of this? Is somebody working on converting the magic comments?


Help with this is welcome, in particular for files that are not already fixed in https://github.com/sagemath/sage/pull/35095

The improved "sage -fixdoctests" tool assists with it: https://github.com/sagemath/sage/wiki/Sage-10.1-Release-Tour#sage--fixdoctests

Kwankyu Lee

unread,
Aug 3, 2023, 8:29:30 PM8/3/23
to sage-devel
On Friday, August 4, 2023 at 1:54:53 AM UTC+9 Volker Braun wrote:
The test output is full of "Warning: Consider using a block-scoped tag by inserting the line...", making it hard to see where the actual error is. 

I agree. Hopefully, the warnings would be removed soon if more people work on them . Fortunately the tool "sage -fixdoctests"  improved by


is very efficient  as it handles directories just like "sage -t". For example, you can run "sage -fixdoctests src/sage/schemes/toric", that will fix all files in the directory tree.

Actually it would make a sense that we create a mega PR by running "sage -fixdoctests src/sage" as soon as #36024 gets in beta. 

John H Palmieri

unread,
Aug 4, 2023, 5:45:21 PM8/4/23
to sage-devel
I appreciate the description of the changes in `sage --fixdoctests` in the release tour, but are these features described anywhere in Sage's documentation? I didn't see anything at #35749 or #36024.

Matthias Koeppe

unread,
Aug 4, 2023, 5:51:06 PM8/4/23
to sage-devel
Yes, the release tour contains a link to the new section in the developer's guide - https://sagemath-tobias.netlify.app/developer/doctesting.html#the-doctest-fixer

John H Palmieri

unread,
Aug 4, 2023, 7:06:31 PM8/4/23
to sage-devel
Great!

I like Kwankyu's suggestion that once #36024 is merged (and #36026 and #35095), just run "sage --fixdoctests" on the whole Sage library.

Kwankyu Lee

unread,
Aug 4, 2023, 7:40:21 PM8/4/23
to sage-devel
I like Kwankyu's suggestion that once #36024 is merged (and #36026 and #35095), just run "sage --fixdoctests" on the whole Sage library.

As we just fixes comments (doctest tags), actually we don't need to wait those PRs to be merged. 

Matthias is already fixing them gradually. See https://github.com/sagemath/sage/pull/36033, for instance.

Still, fixing them on the whole Sage library in a PR seems not a bad idea.
Reply all
Reply to author
Forward
0 new messages