Skip to content

Commit 2e4ee6b

Browse files
authored
Merge pull request #377 from synonymdev/ci/copilot-code-review
Set Copylot code review instructions
2 parents d42a876 + 3c8fffa commit 2e4ee6b

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/copilot-instructions.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# GitHub Copilot Code Review Instructions
2+
3+
When performing a code review, respond in English.
4+
5+
## Architecture & Patterns
6+
7+
When performing a code review, ensure ViewModels are never injected as dependencies into services or repositories. Only Android activities and composable functions should use ViewModels.
8+
9+
When performing a code review, verify that all async operations use `viewModelScope.launch` instead of `GlobalScope.launch` in ViewModels.
10+
11+
When performing a code review, ensure Repository pattern is followed
12+
13+
When performing a code review, verify StateFlow is used for reactive state management in ViewModels with proper `_uiState` and `uiState` pattern.
14+
15+
## Error Handling & Safety
16+
17+
When performing a code review, flag any use of the not-null assertion operator (`!!`) and suggest safe calls (`?.`) with proper null handling.
18+
19+
When performing a code review, ensure all coroutine operations use proper error handling with `runCatching`
20+
21+
## UI & Compose Best Practices
22+
23+
When performing a code review, ensure all user-facing strings use `stringResource(R.string.*)` instead of hardcoded strings.
24+
25+
When performing a code review, verify that expensive Compose computations are wrapped in `remember` blocks.
26+
27+
When performing a code review, check that Material3 design guidelines are followed for UI components.
28+
29+
When performing a code review, ensure proper state management patterns with `MutableStateFlow` and `StateFlow`.
30+
31+
## Code Quality & Readability
32+
33+
When performing a code review, focus on readability and avoid nested if-else, replacing with early return wherever possible.
34+
35+
When performing a code review, ensure unused code is removed after refactoring.
36+
37+
When performing a code review, verify that existing extensions and utilities are used rather than creating duplicate functionality.
38+
39+
## Dependency Injection & Services
40+
41+
When performing a code review, verify proper Hilt dependency injection patterns are followed.
42+
43+
When performing a code review, ensure services contain business logic and don't directly depend on ViewModels.
44+
45+
## Build & Testing
46+
47+
When performing a code review, suggest Unit Test for composable components and business logic covering the most important cases
48+
49+
## Lightning & Bitcoin Specific
50+
51+
When performing a code review, verify that Bitcoin/Lightning operations are properly handled in the service layer.
52+
53+
When performing a code review, verify that propper Bitcoin and Lightning technical terms are used when naming code components
54+
55+
## Performance & Memory
56+
57+
When performing a code review, check for potential memory leaks in coroutines and ensure proper scope usage.
58+
59+
When performing a code review, verify that database operations use Room patterns correctly.
60+
61+
When performing a code review, ensure network operations use Ktor patterns and proper error handling.
62+
63+
## Documentation & Maintenance
64+
65+
When performing a code review, ensure code follows the established patterns from the existing codebase.
66+
67+
When performing a code review, verify that complex business logic is properly documented.
68+
69+
When performing a code review, check that new features integrate well with the existing MVVM architecture.

0 commit comments

Comments
 (0)