From 3f458f6ecfb2a884d8125000cb4c69938e65b57d Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Sat, 5 Oct 2024 00:16:50 +0900 Subject: [PATCH] docs: update guidelines_code.md accross -> across --- backend/core/tests/processor/data/guidelines_code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/core/tests/processor/data/guidelines_code.md b/backend/core/tests/processor/data/guidelines_code.md index 6610a44785a8..7b084296beea 100644 --- a/backend/core/tests/processor/data/guidelines_code.md +++ b/backend/core/tests/processor/data/guidelines_code.md @@ -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.**