-
Notifications
You must be signed in to change notification settings - Fork 539
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
Add CI check to ensure all TextViews have a style check #3972
Comments
/cc @veena14cs |
@BenHenning I would like to work on this issue |
Sounds good! Assigning this to you @yash10019coder. |
Unassigning myself to free it up for others. Will pick it up later if it's still available. |
HI @adhiamboperes can i work on this issue, i'll add the requested TextViewStyleChecker script. |
@manas-yu, could you please provide an outline of how you would approach this issue? |
@adhiamboperes I'll add the |
I would defer to @BenHenning for further clarification. |
<!-- READ ME FIRST: Please fill in the explanation section below and check off every point from the Essential Checklist! --> ## Explanation Fix #3972 This PR adds a script, `TextViewStyleCheck.kt`, which ensures that all `TextView` elements in the layout XML files use centrally managed styles. If any `TextView` 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)` To execute the tests, use: `bazel test //scripts/src/javatests/org/oppia/android/scripts/xml:TextViewStyleCheckTest` made changes to the `scripts/assets/todo_open_exemptions.textproto` as the TextviewStyleCheck script was added ## Essential Checklist <!-- Please tick the relevant boxes by putting an "x" in them. --> - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).
Related issue: #3971. We need to make sure that TextViews have a centrally managed style set so that RTL/LTR settings can be properly managed. To do this, we need a CI check that runs a script which parses all layout files to ensure that TextView elements have a style set that corresponds to a local codebase style (i.e. uses
@style/
).For reference, I suggest looking at the manifest transformation script since it parses & modifies XML today (so it's a good basis for the parsing needs of this new TextView script).
The text was updated successfully, but these errors were encountered: