[None][doc] Update Python coding guidelines.#12439
Conversation
cbd25d8 to
a6d3e29
Compare
📝 WalkthroughWalkthroughPython section of Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CODING_GUIDELINES.md`:
- Line 455: Summary: The document uses “doc strings” in one place but the
project style uses “docstrings” consistently. Fix: replace the phrase “doc
strings” with “docstrings” in the sentence that currently reads “Externally
called functions should have doc strings, and their arguments should be
documented.” to match the rest of the document’s terminology; ensure any nearby
occurrences in the same paragraph also use “docstrings” consistently.
- Line 526: Update the prose to hyphenate the terms by changing the phrase
"Static type checking at pre-commit time is opt in by submodule PICs" to "Static
type checking at pre-commit time is opt-in by submodule PICs" and ensure any
occurrences of "built in" are changed to "built-in"; apply the same hyphenation
to the related occurrence referenced as "Also applies to: 538-538" so both
instances use "opt-in" and "built-in" consistently throughout the sentence(s).
- Around line 533-536: The example for class Foo is malformed because an
embedded control character merged the class and __init__ lines; fix by removing
the control character and placing "class Foo:" and "def __init__(self, x: int)
-> None:" on separate lines with proper indentation, ensure the assignment lines
use correct indentation for self.x and self.y, and add "from typing import
Optional" at the top of the example if Optional is not already imported so the
annotation on y: Optional[int] is valid.
- Line 357: The formatting note contains mismatched quotation marks: the phrase
“legacy” files and “new" files mixes a smart opening quote with a straight
closing quote; update the sentence so both quoted words use matching quotes
(e.g., change “new" files to “new” files or convert both to straight quotes
"legacy" and "new") to ensure consistent quotation in the sentence containing
“legacy” files and “new" files and the reference to <pyproject.toml>.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: dd351aad-a8fb-4750-95f4-595c3ad917c6
📒 Files selected for processing (1)
CODING_GUIDELINES.md
Signed-off-by: Harris Nover <249353502+hnover-nv@users.noreply.github.com>
a6d3e29 to
72588fb
Compare
|
/bot run |
|
PR_Github #39972 [ run ] triggered by Bot. Commit: |
|
PR_Github #39972 [ run ] completed with state
|
|
/bot run |
|
PR_Github #39984 [ run ] triggered by Bot. Commit: |
|
PR_Github #39984 [ run ] completed with state
|
|
/bot run |
|
PR_Github #40032 [ run ] triggered by Bot. Commit: |
|
PR_Github #40032 [ run ] completed with state |
Description
Update Python coding guidelines, to better match both current and desired usage.
The most noteworthy changes are
Test Coverage
None
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
[ x ] Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.Summary by CodeRabbit
Documentation
__all__maintenance), and refined naming conventions for constants, non-public identifiers, and device/host container objects.