-
Notifications
You must be signed in to change notification settings - Fork 1
feat(OK-123): 코드래빗 코드리뷰 yml 파일 작성 #41
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
Changes from all commits
c8b8c01
3da7388
9442470
1eeff8e
16e21b8
9da4573
4bb3bc9
fb18206
5a00b97
3ce657c
b461bde
1a6e6f6
6521d8f
3547c33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| review: | ||
| model: gpt-3.5 # 또는 'gpt-4' (유료 요금제 사용 시) | ||
| language: ko | ||
| files: | ||
| - include: '**/*.ts' | ||
| - include: '**/*.tsx' | ||
| - exclude: '**/*.test.ts' | ||
| - exclude: '**/*.spec.ts' | ||
|
|
||
| prompt: | | ||
| You are a senior React Native developer reviewing a pull request in a production-level project. | ||
|
|
||
| 🛠️ Project Stack: | ||
| - React Native with Expo | ||
| - TypeScript | ||
| - OpenAPI-based API handling | ||
| - App router-based navigation (like Expo Router or similar) | ||
|
|
||
| Your goal is to: | ||
| 1. Focus on **performance issues**, especially those that may cause unnecessary re-renders, inefficient rendering in lists, or redundant API calls. | ||
| 2. Identify areas that are **likely to throw runtime errors**, especially "Cannot read property of undefined", null dereferencing, or optional chaining misuses. | ||
| 3. Suggest better **modularization**, such as breaking down components or extracting hooks/utilities if any logic is too large or repeated. | ||
| 4. Point out places where **better patterns or abstraction** could improve readability and maintainability (e.g., custom hooks, reusable UI components). | ||
| 5. Suggest **alternative approaches** where applicable (e.g., using FlatList instead of ScrollView, memoizing with useMemo, useCallback, etc.) | ||
| 6. Mention if any **types are too generic or unsafe** (e.g., use of any, improper inference). | ||
|
|
||
| Output your response in **clear sections**: Performance, Error Safety, Modularization, Suggestions. | ||
|
|
||
| If everything looks good, say LGTM ✅ under each section. | ||
| Always write in Korean. |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,14 +12,14 @@ import { patientCardStyles, styles } from './styles'; | |||||||
|
|
||||||||
| const PatientListPage = () => { | ||||||||
| const result = useGetPatientList(); | ||||||||
| const data = result?.data ?? []; | ||||||||
| const data = result?.data; | ||||||||
| const isLoading = result?.isLoading ?? false; | ||||||||
|
|
||||||||
| return ( | ||||||||
| <SafeAreaView style={styles.safeArea} edges={['left', 'right', 'top']}> | ||||||||
| <Header containerStyle={styles.headerContainer} title="환자 관리" /> | ||||||||
| <View style={styles.container}> | ||||||||
| {data?.length === 0 ? ( | ||||||||
| {data.length === 0 ? ( | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 널 체크 없이 직접 속성에 접근하고 있습니다. 이전 코드에서는 아마도 다음과 같이 변경하는 것을 제안합니다: - {data.length === 0 ? (
+ {data?.length === 0 ? (또는 15번 줄에서 빈 배열 기본값을 제공하는 경우: - {data.length === 0 ? (
+ {data.length === 0 ? (📝 Committable suggestion
Suggested change
|
||||||||
| <NoPatients /> | ||||||||
| ) : ( | ||||||||
| <ScrollView style={patientCardStyles.scrollViewStyle}> | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
타입 안전성 문제가 발생할 수 있습니다.
result?.data에서 기본값[]을 제거했습니다. 그러나 이렇게 하면data가undefined나null일 때 타입 안전성 문제가 발생할 수 있습니다. 22번 줄에서data.length를 직접 접근하고 있기 때문에 런타임 오류가 발생할 가능성이 있습니다.다음과 같이 변경하는 것을 제안합니다:
📝 Committable suggestion