-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use and document default numerical formatting #191
Conversation
Run `format()` before starting tests. This ensures docs match the out-of-the-box formatting that users see. By actively calling `format`, we ensure consistency for developers who may have custom formatting in their config files. A downside is that we overwrite user's custom formatting. Partially fixes #183.
Thank you! Perhaps @mtmiller can advise on the Unfortunately I don't have MATLAB available currently, otherwise I would be happy to run the tests. |
That is only because of function scope, |
inst/doctest.m
Outdated
@@ -285,12 +310,35 @@ | |||
summary.num_tests = 0; | |||
summary.num_tests_passed = 0; | |||
|
|||
% stash user's formatting | |||
if (is_octave) | |||
if (compare_versions(OCTAVE_VERSION(), '4.3.0', '>=')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend changing this to 4.4.0
, 4.3.0 was a development version, shouldn't exist anywhere now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it still be more logical to test for 4.3.0 since the "old" way of doing it will fail there (if I understand gnu-octave/symbolic#713 (comment) right)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, there are probably some range of commits where neither works...
People running old dev versions get to keep both pieces :-)
Or we could bump our min version to 4.4 and simplify this...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a try-catch version with no version testing: personally I'm not a fan is this kind of laisez-faire Python-esque code, but it does satisfy both your comments :)
I forgot to mention a potential downside of this: projects cannot write all their docs using e.g.,
But I don't know of any project doing that so I don't think we should worry... Ok to merge? |
I've now tested on Matlab, I'll merge now. |
No description provided.