Skip to content

[Docs] Add source code blocks for methods#1229

Merged
SumanthRH merged 2 commits intomainfrom
source-per-method
Feb 27, 2026
Merged

[Docs] Add source code blocks for methods#1229
SumanthRH merged 2 commits intomainfrom
source-per-method

Conversation

@SumanthRH
Copy link
Copy Markdown
Member

@SumanthRH SumanthRH commented Feb 26, 2026

What does this PR do?

Adds source code blocks for methods. Currently, source code blocks are shown only for classes.


Open with Devin

Signed-off-by: SumanthRH <sumanthrh99@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
x
Signed-off-by: SumanthRH <sumanthrh99@gmail.com>
@SumanthRH SumanthRH marked this pull request as ready for review February 27, 2026 02:26
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the documentation generation script to add source code blocks for methods, not just top-level classes and functions. The changes are well-structured, breaking down the logic into smaller helper functions and using a two-pass approach to inject the source code into the generated Markdown. This is a great improvement. My feedback focuses on improving error handling by replacing broad except Exception clauses with more specific exception types, which will make the code more robust and easier to debug.

Comment on lines 307 to +308
except Exception:
return md
return None, None, None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Catching a broad Exception can hide unrelated errors. It's better to be specific. In this case, obj might be missing attributes, so AttributeError would be more appropriate.

Suggested change
except Exception:
return md
return None, None, None
except AttributeError:
return None, None, None

Comment on lines +318 to +319
except Exception:
return None, None, None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using a broad except Exception can mask unexpected issues. For file I/O, it's better to catch specific exceptions like IOError or FileNotFoundError.

Suggested change
except Exception:
return None, None, None
except (IOError, FileNotFoundError):
return None, None, None

Comment on lines +373 to +374
except Exception:
continue
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To avoid hiding potential bugs, it's best to catch specific exceptions instead of a general Exception. Here, AttributeError would be more suitable if a member object is missing expected attributes like kind, lineno, or endlineno.

Suggested change
except Exception:
continue
except AttributeError:
continue

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@SumanthRH SumanthRH merged commit 83d2bd7 into main Feb 27, 2026
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 this pull request may close these issues.

1 participant