-
Notifications
You must be signed in to change notification settings - Fork 86
LCORE-1374: Contributing guide #1224
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
Merged
tisnik
merged 1 commit into
lightspeed-core:main
from
tisnik:lcore-1374-contributing-guide
Feb 25, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,12 @@ | |
| * [Pylint](#pylint) | ||
| * [Security checks](#security-checks) | ||
| * [Code style](#code-style) | ||
| * [Function Standards](#function-standards) | ||
| * [Documentation](#documentation) | ||
| * [Type annotations](#type-annotations) | ||
| * [Naming conventions](#naming-conventions) | ||
| * [Async functions](#async-functions) | ||
| * [Error handling](#error-handling) | ||
| * [Formatting rules](#formatting-rules) | ||
| * [Docstrings style](#docstrings-style) | ||
|
|
||
|
|
@@ -227,6 +233,33 @@ make security-check | |
|
|
||
| ## Code style | ||
|
|
||
| ### Function Standards | ||
|
|
||
| #### Documentation | ||
|
|
||
| All functions require docstrings with brief descriptions | ||
|
|
||
| #### Type annotations | ||
|
|
||
| Use complete type annotations for parameters and return types | ||
|
|
||
| - Use `typing_extensions.Self` for model validators | ||
| - Union types: `str | int` (modern syntax) | ||
| - Optional: `Optional[Type]` | ||
|
|
||
| #### Naming conventions | ||
|
|
||
| Use snake_case with descriptive, action-oriented names (get_, validate_, check_) | ||
|
|
||
| #### Async functions | ||
|
|
||
| Use `async def` for I/O operations and external API calls | ||
|
|
||
| #### Error handling | ||
|
|
||
| - Use FastAPI `HTTPException` with appropriate status codes for API endpoints | ||
| - Handle `APIConnectionError` from Llama Stack where appropriate | ||
|
Comment on lines
+240
to
+261
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prose lines in the new section are missing terminal periods. Lines 240, 244, 252, and 256 each end a sentence without a full stop. This is inconsistent with the surrounding documentation style. 🤖 Prompt for AI Agents |
||
|
|
||
| ### Formatting rules | ||
|
|
||
| Code formatting rules are checked by __Black__. More info can be found on [https://black.readthedocs.io/en/stable/](https://black.readthedocs.io/en/stable/). | ||
|
|
||
Oops, something went wrong.
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.
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.
Optional[Type]contradicts the adjacent modern-syntax recommendation.The guide promotes PEP 604
str | intsyntax (modern) on line 247, but then prescribes the legacyOptional[Type]form on line 248. Since the project requires Python 3.12+, both union and optional should use the modern union syntax (Type | None) for consistency.✏️ Suggested update
📝 Committable suggestion
🤖 Prompt for AI Agents