[FIX] fixes root m file processing#315
Conversation
The main point is to maintain interface to the user so that these types of blocks continue to work.
No ".. mat:currentmodule :: ." needed. All unit tests are still passing.
|
just to be sure: there was no issue for this, right? |
| arguments = argblock_match.get("args") | ||
|
|
||
| # Bug fix: Check if arguments is None before iterating | ||
| if arguments is None: |
There was a problem hiding this comment.
Should this be necessary? The * operator in q_argblock should return the empty list for the args capture name.
Either way this shouldn't hurt to add but would be good to add a test for this.
There was a problem hiding this comment.
Also probably no need to have Bug fix in the comment, as it only adds semantic noise.
| if not modname: | ||
| modname = self.env.temp_data.get("mat:module") | ||
| # ... else, it stays None, which means invalid | ||
| # ... else, default to root module (empty string) |
There was a problem hiding this comment.
Hmm, is this always a sane default? I suspect that this can lead to subtle bugs where things that were considered invalid before will now get dumbed in the "root" module.
| # for implicit module members, check __module__ to avoid | ||
| # documenting imported objects | ||
| return True, self.object.safe_getmembers() | ||
| members = self.object.safe_getmembers() |
There was a problem hiding this comment.
No need to declare the local variable here.
No, there was no GitHub issue. The unreleased version doesn't handle m-files in the root well. The previous version struggled too, but there was a workaround setting |
Co-authored-by: Remi Gau <remi_gau@hotmail.com>
759c14c to
28f6c63
Compare
|
I see that @Remi-Gau is making direct changes to the master branch solo. I will wait till he is finished and then work on this branch. |
|
@jasonnicholson I will fix the merge conflicts |
Thank you |
This addresses files in the root of matlab_src_dir. The following will now work:
This one documents everything in the global namespace in matlab_src_dir: