refactor: simplify and modernize mkdoc_lib - #63
Open
henryiii wants to merge 1 commit into
Open
Conversation
Cleanup only, no behavior change: - merge the identical param_arg_re and raises_arg_re into named_arg_re - drop the unused return values from extract() - use a plain dict for CPP_OPERATORS, which keeps the by-length order - remove the Python 2 d() decode helper; cindex gives str - use an f-string in write_header and str.removesuffix in sanitize_name - precompile the inline regexes of process_comment at module level Assisted-by: ClaudeCode:claude-fable-5
henryiii
marked this pull request as draft
August 6, 2026 18:18
henryiii
marked this pull request as ready for review
August 6, 2026 20:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
Addresses the simplification and modernization items from the review in #59. Cleanup only, the generated headers stay identical.
param_arg_reandraises_arg_rewere the same pattern, so they are now onenamed_arg_re.extract()mixedreturn 0andreturn None, but no caller reads the value. The returns are gone.CPP_OPERATORSuses a plaindict, which keeps insertion order since Python 3.7. The sort by length stays.d()helper decoded bytes for Python 2. The python3 cindex bindings givestr, so it and its call sites are removed.write_headeruses an f-string, andsanitize_nameusesstr.removesuffix.re.subpatterns ofprocess_commentare precompiled module-level constants.