Skip to content
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

docs: update guidelines_code.md #3324

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/core/tests/processor/data/guidelines_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- Asynchronous code
- Don’t replicate object that are Standalone/Singleton or with heavy dependencies. All python objects are references. Use the references: 🔺🔺🔺
- **Example**: Recreating a `BrainService` inside a function is an antipattern. This function should take `service : BrainService` as a parameter ( also easily testable via dependency injection)
- **Example**: Recreating a class that connects to a `APIService` is an antipattern. Connection creation is pretty costly process. You should the a **single object** and pass it accross function calls
- **Example**: Recreating a class that connects to a `APIService` is an antipattern. Connection creation is pretty costly process. You should the a **single object** and pass it across function calls
- Error handling:
- Use specific exception types rather than catching all exceptions. The caller can then `try .. except CustomException`
- Create custom exception classes for **application-specific errors.**
Expand Down