-
Notifications
You must be signed in to change notification settings - Fork 527
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
Fix #3972: Added TextViewStyleCheck script #5599
base: develop
Are you sure you want to change the base?
Conversation
@adhiamboperes PTAL. I've added the Could you please confirm if this output is appropriate? If there’s an issue with the script or if you’d like any adjustments, please let me know! Here is the current output: Files being reported
bazel run //scripts:check_textview_styles -- $(pwd)
INFO: Analyzed target //scripts:check_textview_styles (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //scripts:check_textview_styles up-to-date:
bazel-bin/scripts/check_textview_styles.jar
bazel-bin/scripts/check_textview_styles.jdeps
INFO: Elapsed time: 1.388s, Critical Path: 1.09s
INFO: 3 processes: 1 internal, 1 linux-sandbox, 1 worker.
INFO: Build completed successfully, 3 total actions
INFO: Running command line: bazel-bin/scripts/check_textview_styles /home/manas/opensource/oppia-android
TextView Style Check FAILED:
/home/manas/opensource/oppia-android/app/src/main/res/layout-land/question_player_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-land/profile_progress_header.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-land/create_profile_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-land/walkthrough_final_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp-port/onboarding_app_language_selection_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp-port/question_player_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp-port/onboarding_profile_type_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp-port/create_profile_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/feedback_item.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/test_text_view_for_int_with_data_binding.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/beta_notice_dialog_content.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/story_header_view.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/drawer_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/test_margin_bindable_adapter_activity.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/selection_interaction_item.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/question_player_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/multiple_choice_interaction_items.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/profile_reset_pin_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/onboarding_language_dropdown_item.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/lessons_completed_chapter_view.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/audio_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/app_version_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/state_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/test_text_view_for_live_data_with_data_binding.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/app_language_item.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/content_item.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/onboarding_profile_type_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/bottom_sheet_options_menu_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/submitted_answer_item.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/lessons_in_progress_chapter_view.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/coming_soon_topic_view.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/revision_card_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/profile_list_sync_status_item.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/lessons_locked_chapter_view.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/license_text_viewer_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/create_profile_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/walkthrough_welcome_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/test_text_view_bindable_adapter_activity.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/story_chapter_view.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/item_selection_interaction_items.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/profile_picture_edit_dialog.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/audio_language_item.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/walkthrough_topic_summary_view.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/walkthrough_final_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/lessons_not_started_chapter_view.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/promoted_story_card.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/profile_list_learner_id_item.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/survey_multiple_choice_item.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/general_availability_upgrade_notice_dialog_content.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout/welcome.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp-land/onboarding_app_language_selection_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp-land/question_player_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp-land/onboarding_profile_type_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp-land/create_profile_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp-land/topic_info_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp-land/resume_lesson_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp/option_activity.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp/options_without_drawer_activity.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp/profile_progress_header.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp/administrator_controls_activity.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp/revision_card_fragment.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp/story_chapter_view.xml
/home/manas/opensource/oppia-android/app/src/main/res/layout-sw600dp/profile_chooser_fragment.xml
Exception in thread "main" java.lang.Exception: Some TextView elements do not have centrally managed styles.
at org.oppia.android.scripts.xml.TextViewStyleCheckKt.main(TextViewStyleCheck.kt:55)
|
Coverage ReportResultsNumber of files assessed: 1 Failure Cases
|
APK & AAB differences analysisNote that this is a summarized snapshot. See the CI artifacts for detailed differences. DevExpand to see flavor specificsUniversal APKAPK file size: 19 MiB (old), 19 MiB (new), 0 bytes (No change) APK download size (estimated): 17 MiB (old), 17 MiB (new), 6 bytes (Added) Method count: 260195 (old), 260195 (new), 0 (No change) Features: 2 (old), 2 (new), 0 (No change) Permissions: 6 (old), 6 (new), 0 (No change) Resources: 6818 (old), 6818 (new), 0 (No change)
Lesson assets: 111 (old), 111 (new), 0 (No change) AAB differencesExpand to see AAB specificsSupported configurations:
Base APKAPK file size: 18 MiB (old), 18 MiB (new), 0 bytes (No change) Configuration hdpiAPK file size: 50 KiB (old), 50 KiB (new), 0 bytes (No change) Configuration ldpiAPK file size: 49 KiB (old), 49 KiB (new), 0 bytes (No change) Configuration mdpiAPK file size: 45 KiB (old), 45 KiB (new), 0 bytes (No change) Configuration tvdpiAPK file size: 86 KiB (old), 86 KiB (new), 0 bytes (No change) Configuration xhdpiAPK file size: 57 KiB (old), 57 KiB (new), 0 bytes (No change) Configuration xxhdpiAPK file size: 63 KiB (old), 63 KiB (new), 0 bytes (No change) Configuration xxxhdpiAPK file size: 63 KiB (old), 63 KiB (new), 0 bytes (No change) AlphaExpand to see flavor specificsUniversal APKAPK file size: 11 MiB (old), 11 MiB (new), 4 bytes (Removed) APK download size (estimated): 10 MiB (old), 10 MiB (new), 0 bytes (No change) Method count: 116265 (old), 116265 (new), 0 (No change) Features: 2 (old), 2 (new), 0 (No change) Permissions: 6 (old), 6 (new), 0 (No change) Resources: 5786 (old), 5786 (new), 0 (No change)
Lesson assets: 111 (old), 111 (new), 0 (No change) AAB differencesExpand to see AAB specificsSupported configurations:
Base APKAPK file size: 11 MiB (old), 11 MiB (new), 0 bytes (No change) Configuration hdpiAPK file size: 43 KiB (old), 43 KiB (new), 0 bytes (No change) Configuration ldpiAPK file size: 44 KiB (old), 44 KiB (new), 0 bytes (No change) Configuration mdpiAPK file size: 38 KiB (old), 38 KiB (new), 0 bytes (No change) Configuration tvdpiAPK file size: 73 KiB (old), 73 KiB (new), 0 bytes (No change) Configuration xhdpiAPK file size: 50 KiB (old), 50 KiB (new), 0 bytes (No change) Configuration xxhdpiAPK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change) Configuration xxxhdpiAPK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change) BetaExpand to see flavor specificsUniversal APKAPK file size: 11 MiB (old), 11 MiB (new), 0 bytes (No change) APK download size (estimated): 10 MiB (old), 10 MiB (new), 0 bytes (No change) Method count: 116271 (old), 116271 (new), 0 (No change) Features: 2 (old), 2 (new), 0 (No change) Permissions: 6 (old), 6 (new), 0 (No change) Resources: 5786 (old), 5786 (new), 0 (No change)
Lesson assets: 111 (old), 111 (new), 0 (No change) AAB differencesExpand to see AAB specificsSupported configurations:
Base APKAPK file size: 11 MiB (old), 11 MiB (new), 0 bytes (No change) Configuration hdpiAPK file size: 43 KiB (old), 43 KiB (new), 0 bytes (No change) Configuration ldpiAPK file size: 44 KiB (old), 44 KiB (new), 0 bytes (No change) Configuration mdpiAPK file size: 38 KiB (old), 38 KiB (new), 0 bytes (No change) Configuration tvdpiAPK file size: 73 KiB (old), 73 KiB (new), 0 bytes (No change) Configuration xhdpiAPK file size: 50 KiB (old), 50 KiB (new), 0 bytes (No change) Configuration xxhdpiAPK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change) Configuration xxxhdpiAPK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change) GaExpand to see flavor specificsUniversal APKAPK file size: 11 MiB (old), 11 MiB (new), 4 bytes (Removed) APK download size (estimated): 10 MiB (old), 10 MiB (new), 8 bytes (Added) Method count: 116271 (old), 116271 (new), 0 (No change) Features: 2 (old), 2 (new), 0 (No change) Permissions: 6 (old), 6 (new), 0 (No change) Resources: 5786 (old), 5786 (new), 0 (No change)
Lesson assets: 111 (old), 111 (new), 0 (No change) AAB differencesExpand to see AAB specificsSupported configurations:
Base APKAPK file size: 11 MiB (old), 11 MiB (new), 4 bytes (Removed) Configuration hdpiAPK file size: 43 KiB (old), 43 KiB (new), 0 bytes (No change) Configuration ldpiAPK file size: 44 KiB (old), 44 KiB (new), 0 bytes (No change) Configuration mdpiAPK file size: 38 KiB (old), 38 KiB (new), 0 bytes (No change) Configuration tvdpiAPK file size: 73 KiB (old), 73 KiB (new), 0 bytes (No change) Configuration xhdpiAPK file size: 50 KiB (old), 50 KiB (new), 0 bytes (No change) Configuration xxhdpiAPK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change) Configuration xxxhdpiAPK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change) |
Explanation
Fix #3972
This PR adds a script,
TextViewStyleCheck.kt
, which ensures that allTextView
elements in the layout XML files use centrally managed styles. If anyTextView
does not have a style attribute that starts with@style/
, an error is reported, indicating the file path where the violation occurs.bazel run //scripts:check_textview_styles -- $(pwd)
Essential Checklist