Skip to content

Commit 0c431d0

Browse files
committed
chore: update rules to enforce withContext use
1 parent f8d53f8 commit 0c431d0

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ suspend fun getData(): Result<Data> = withContext(Dispatchers.IO) {
210210
- PREFER to use one-liners with `run {}` when applicable, e.g. `override fun someCall(value: String) = run { this.value = value }`
211211
- ALWAYS add imports instead of inline fully-qualified names
212212
- PREFER to place `@Suppress()` annotations at the narrowest possible scope
213+
- ALWAYS wrap suspend functions in `withContext(bgDispatcher)` if in domain layer, using ctor injected prop `@BgDispatcher private val bgDispatcher: CoroutineDispatcher`
213214

214215
### Architecture Guidelines
215216

0 commit comments

Comments
 (0)