Skip to content

Commit 316341a

Browse files
authored
Merge pull request #1224 from tisnik/lcore-1374-contributing-guide
LCORE-1374: Contributing guide
2 parents 71b93ea + 2d8c484 commit 316341a

2 files changed

Lines changed: 66 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
* [Pylint](#pylint)
2323
* [Security checks](#security-checks)
2424
* [Code style](#code-style)
25+
* [Function Standards](#function-standards)
26+
* [Documentation](#documentation)
27+
* [Type annotations](#type-annotations)
28+
* [Naming conventions](#naming-conventions)
29+
* [Async functions](#async-functions)
30+
* [Error handling](#error-handling)
2531
* [Formatting rules](#formatting-rules)
2632
* [Docstrings style](#docstrings-style)
2733

@@ -227,6 +233,33 @@ make security-check
227233

228234
## Code style
229235

236+
### Function Standards
237+
238+
#### Documentation
239+
240+
All functions require docstrings with brief descriptions
241+
242+
#### Type annotations
243+
244+
Use complete type annotations for parameters and return types
245+
246+
- Use `typing_extensions.Self` for model validators
247+
- Union types: `str | int` (modern syntax)
248+
- Optional: `Optional[Type]`
249+
250+
#### Naming conventions
251+
252+
Use snake_case with descriptive, action-oriented names (get_, validate_, check_)
253+
254+
#### Async functions
255+
256+
Use `async def` for I/O operations and external API calls
257+
258+
#### Error handling
259+
260+
- Use FastAPI `HTTPException` with appropriate status codes for API endpoints
261+
- Handle `APIConnectionError` from Llama Stack where appropriate
262+
230263
### Formatting rules
231264

232265
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/).

docs/contributing_guide.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
* [Pylint](#pylint)
2323
* [Security checks](#security-checks)
2424
* [Code style](#code-style)
25+
* [Function Standards](#function-standards)
26+
* [Documentation](#documentation)
27+
* [Type annotations](#type-annotations)
28+
* [Naming conventions](#naming-conventions)
29+
* [Async functions](#async-functions)
30+
* [Error handling](#error-handling)
2531
* [Formatting rules](#formatting-rules)
2632
* [Docstrings style](#docstrings-style)
2733

@@ -227,6 +233,33 @@ make security-check
227233

228234
## Code style
229235

236+
### Function Standards
237+
238+
#### Documentation
239+
240+
All functions require docstrings with brief descriptions
241+
242+
#### Type annotations
243+
244+
Use complete type annotations for parameters and return types
245+
246+
- Use `typing_extensions.Self` for model validators
247+
- Union types: `str | int` (modern syntax)
248+
- Optional: `Optional[Type]`
249+
250+
#### Naming conventions
251+
252+
Use snake_case with descriptive, action-oriented names (get_, validate_, check_)
253+
254+
#### Async functions
255+
256+
Use `async def` for I/O operations and external API calls
257+
258+
#### Error handling
259+
260+
- Use FastAPI `HTTPException` with appropriate status codes for API endpoints
261+
- Handle `APIConnectionError` from Llama Stack where appropriate
262+
230263
### Formatting rules
231264

232265
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/).

0 commit comments

Comments
 (0)