-
Notifications
You must be signed in to change notification settings - Fork 5
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
improve lint ci #160
improve lint ci #160
Conversation
WalkthroughThis pull request encompasses a comprehensive set of changes across multiple files, primarily focusing on code formatting, minor logic refinements, and workflow configuration improvements. The modifications span GitHub Actions workflow configuration, Firebase service management, error handling in network requests, and various UI component and view model adjustments. The changes aim to enhance code readability, improve error reporting, and streamline configuration management without introducing significant functional alterations. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
fc47f84
to
6bb8427
Compare
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.
Actionable comments posted: 0
🧹 Nitpick comments (5)
khelo/lib/ui/flow/team/team_list_view_model.dart (1)
52-53
: LGTM! Consider enhancing error logging.The formatting change improves readability by breaking the stream chain into logical segments. While the error handling is comprehensive, consider enhancing the error logging to include stack traces for better debugging.
}, onError: (e, stack) { state = state.copyWith(loading: false, error: e); - debugPrint("TeamListViewNotifier: error while loading team list -> $e"); + debugPrint("TeamListViewNotifier: error while loading team list -> $e\n$stack"); });data/lib/service/auth/auth_service.dart (2)
73-73
: Check if verificationId is needed elsewhere.
The verificationId is used for verifyOTP, but if you need it for custom logging or analytics, ensure you store it or dispatch it in a separate callback if needed.
75-75
: Timeout callback verification.
The usage of onCodeAutoRetrievalTimeout preserves clarity through the null-aware call, but consider also logging or painting a UI message if the user is still waiting..github/workflows/analyze.yml (2)
22-24
: Add quotes for base64 variables to adhere to shellcheck guidelines.
This helps prevent word splitting issues.Apply the following diff:
- echo $GOOGLE_SERVICE_INFO_PLIST_BASE64 | base64 --decode > ios/Runner/GoogleService-Info.plist - echo $FIREBASE_JSON_BASE64 | base64 --decode > firebase.json - echo $GOOGLE_SERVICES_JSON_BASE64 | base64 --decode > android/app/google-services.json + echo "$GOOGLE_SERVICE_INFO_PLIST_BASE64" | base64 --decode > ios/Runner/GoogleService-Info.plist + echo "$FIREBASE_JSON_BASE64" | base64 --decode > firebase.json + echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > android/app/google-services.json
27-27
: Remove trailing spaces for YAML compliance.
Yamllint flagged trailing spaces on line 27; consider removing them to maintain a cleaner file.- echo $FIREBASE_OPTIONS_BASE64 | base64 --decode > lib/firebase_options.dart·· + echo $FIREBASE_OPTIONS_BASE64 | base64 --decode > lib/firebase_options.dart🧰 Tools
🪛 yamllint (1.35.1)
[error] 27-27: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (27)
.github/workflows/analyze.yml
(2 hunks)data/lib/api/ball_score/ball_score_model.dart
(1 hunks)data/lib/api/leaderboard/leaderboard_model.dart
(1 hunks)data/lib/api/match_event/match_event_model.dart
(1 hunks)data/lib/api/network/client.dart
(0 hunks)data/lib/api/partnership/partnership_model.dart
(2 hunks)data/lib/service/auth/auth_service.dart
(2 hunks)data/lib/service/team/team_service.dart
(1 hunks)data/lib/storage/provider/preferences_provider.dart
(3 hunks)data/lib/utils/combine_latest.dart
(1 hunks)khelo/lib/components/country_code_view.dart
(1 hunks)khelo/lib/ui/flow/home/search/search_view_model.dart
(1 hunks)khelo/lib/ui/flow/matches/add_match/components/match_official_selection_view.dart
(1 hunks)khelo/lib/ui/flow/matches/add_match/components/over_detail_view.dart
(1 hunks)khelo/lib/ui/flow/matches/add_match/select_squad/components/user_detail_sheet.dart
(1 hunks)khelo/lib/ui/flow/matches/match_detail/components/match_detail_scorecard_view.dart
(1 hunks)khelo/lib/ui/flow/matches/match_list_view_model.dart
(1 hunks)khelo/lib/ui/flow/score_board/components/match_complete_sheet.dart
(1 hunks)khelo/lib/ui/flow/team/detail/components/team_detail_member_content.dart
(0 hunks)khelo/lib/ui/flow/team/detail/make_admin/make_team_admin_screen.dart
(3 hunks)khelo/lib/ui/flow/team/search_team/search_team_view_model.dart
(1 hunks)khelo/lib/ui/flow/team/team_list_screen.dart
(1 hunks)khelo/lib/ui/flow/team/team_list_view_model.dart
(1 hunks)khelo/lib/ui/flow/tournament/detail/components/match_group_tag.dart
(1 hunks)khelo/lib/ui/flow/tournament/team_selection/team_selection_view_model.dart
(1 hunks)style/lib/button/back_button.dart
(1 hunks)style/lib/callback/on_visible_callback.dart
(1 hunks)
💤 Files with no reviewable changes (2)
- data/lib/api/network/client.dart
- khelo/lib/ui/flow/team/detail/components/team_detail_member_content.dart
✅ Files skipped from review due to trivial changes (19)
- style/lib/callback/on_visible_callback.dart
- khelo/lib/ui/flow/matches/match_list_view_model.dart
- khelo/lib/ui/flow/matches/add_match/components/match_official_selection_view.dart
- khelo/lib/ui/flow/tournament/team_selection/team_selection_view_model.dart
- data/lib/api/ball_score/ball_score_model.dart
- khelo/lib/ui/flow/tournament/detail/components/match_group_tag.dart
- data/lib/api/leaderboard/leaderboard_model.dart
- khelo/lib/ui/flow/home/search/search_view_model.dart
- style/lib/button/back_button.dart
- khelo/lib/components/country_code_view.dart
- khelo/lib/ui/flow/score_board/components/match_complete_sheet.dart
- khelo/lib/ui/flow/matches/match_detail/components/match_detail_scorecard_view.dart
- khelo/lib/ui/flow/matches/add_match/components/over_detail_view.dart
- data/lib/storage/provider/preferences_provider.dart
- data/lib/service/team/team_service.dart
- khelo/lib/ui/flow/team/team_list_screen.dart
- data/lib/api/match_event/match_event_model.dart
- khelo/lib/ui/flow/team/search_team/search_team_view_model.dart
- data/lib/utils/combine_latest.dart
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/analyze.yml
25-25: shellcheck reported issue in this script: SC2086:info:2:6: Double quote to prevent globbing and word splitting
(shellcheck)
25-25: shellcheck reported issue in this script: SC2086:info:3:6: Double quote to prevent globbing and word splitting
(shellcheck)
25-25: shellcheck reported issue in this script: SC2086:info:4:6: Double quote to prevent globbing and word splitting
(shellcheck)
25-25: shellcheck reported issue in this script: SC2086:info:5:6: Double quote to prevent globbing and word splitting
(shellcheck)
🪛 yamllint (1.35.1)
.github/workflows/analyze.yml
[error] 27-27: trailing spaces
(trailing-spaces)
🔇 Additional comments (10)
khelo/lib/ui/flow/matches/add_match/select_squad/components/user_detail_sheet.dart (1)
19-19
: Re-check parameter usage for onButtonTap.
Currently, the code shows “VoidCallback? onButtonTap” but the summary suggests that this parameter might have been changed to be “required”. Ensure consistent usage: if the parameter must always be provided, consider reinforcing it in both the constructor and the static show method signatures. If optional usage is intentional, ensure callers are properly handling cases where it’s null.
data/lib/api/partnership/partnership_model.dart (2)
29-31
: Better readability with multiline formatting.
No functional changes were introduced in this part. Splitting the parameters into multiple lines makes the code more readable and consistent with the rest of the file, so this improvement is beneficial.
48-48
: Newline at the end of file.
Having a newline at the end of the file is a common best practice to maintain consistency and potentially avoid issues with certain tooling.
khelo/lib/ui/flow/team/detail/make_admin/make_team_admin_screen.dart (3)
125-125
: Verify the ownership logic in the ternary condition.
Currently, if the created_by_user.id
differs from the state.owner.id
, it displays a "remove ownership" title, whereas matching IDs display a "transfer ownership" title. Make sure this reflects the intended flow—i.e., removing ownership from other users vs. transferring from oneself.
137-138
: Minor consistency check for empty screen title.
Using ‘common_transfer_ownership’ for the empty screen title aligns well with the ownership transfer context. This looks good; just ensure that all localized text references remain consistent throughout the app.
165-165
: Smooth alignment of the owner label.
Displaying "Owner" here appears consistent with the rest of the UI labels. Good use of the existing localization key for better readability and consistency.
data/lib/service/auth/auth_service.dart (3)
4-4
: Verify consistently using Riverpod across the auth flow.
The added import for flutter_riverpod is good, but ensure that the rest of this file also follows a consistent pattern of interacting with providers and notifiers.
63-68
: Good use of null-aware callback invocation.
This concise approach avoids conditional checks and keeps the code clean.
71-71
: Ensure the error structure is unaltered when re-thrown.
Your usage of AppError.fromError(e, e.stackTrace) properly captures the exception details. Confirm that the stack trace is preserved in the final error report, as some wrappers may discard backtrace info.
.github/workflows/analyze.yml (1)
41-52
: Great enhancement of the lint process by adding code formatting checks.
Running “dart format . --set-exit-if-changed” before “dart analyze --fatal-infos” ensures code style consistency. If you prefer a more consolidated approach, consider grouping these commands into a single job step or script for each directory.
Add Code Format in lint CI
Summary by CodeRabbit