Skip to content
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

Fixed #4396, #4883 : Add CI checks to ensure Kotlin files , Layout xml files are only referencing colors from component_colors.xml #4882

Merged
merged 29 commits into from
Apr 6, 2023

Conversation

MohitGupta121
Copy link
Member

@MohitGupta121 MohitGupta121 commented Feb 24, 2023

Explanation

Fixed #4396 : Add CI checks to ensure Layout xml files are only referencing colors from component_colors.xml

Fixed #4883 : Add CI checks to ensure Kotlin Files (Activities, Activity Presenters, Fragments, Fragment Presenters, Views, and View Presenters) are only referencing colors from component_colors.xml

Essential Checklist

  • 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: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

Copy link
Member Author

@MohitGupta121 MohitGupta121 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BenHenning PTAL, the check is working fine for all xml files as you see in the CI check failure.
And also Kotlin files checks are failing.

@MohitGupta121 MohitGupta121 changed the title Fixed #4396 : Add CI checks to ensure layout xml files are only referencing colors from component_colors.xml Fixed #4396, #4883 : Add CI checks to ensure layout xml files are only referencing colors from component_colors.xml Feb 24, 2023
@MohitGupta121 MohitGupta121 changed the title Fixed #4396, #4883 : Add CI checks to ensure layout xml files are only referencing colors from component_colors.xml Fixed #4396, #4883 : Add CI checks to ensure Kotlin and Layout files are only referencing colors from component_colors.xml Feb 24, 2023
@MohitGupta121 MohitGupta121 changed the title Fixed #4396, #4883 : Add CI checks to ensure Kotlin and Layout files are only referencing colors from component_colors.xml Fixed #4396, #4883 : Add CI checks to ensure Kotlin files , Layout xml files are only referencing colors from component_colors.xml Feb 24, 2023
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable @MohitGupta121. Is there anything you want me to look at besides the patterns?

scripts/assets/file_content_validation_checks.textproto Outdated Show resolved Hide resolved
@MohitGupta121
Copy link
Member Author

Is there anything you want me to look at besides the patterns?

I don't think anything else expect the Path_Pattern. And nothing from the issue side also as I see.

@BenHenning What do you think ?

@MohitGupta121
Copy link
Member Author

@BenHenning PTAL, Combine kotlin files checks into 1 check
And not find any file whose suffix is ViewPresenter, So I keep it as it.
But we have files whose prefix is View but unable to get expression pattern for that. So can you please help in that.

Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MohitGupta121. Do you have examples for views that use 'View' as a prefix that would need updating?

Also, please update the PR description to have the fixed issues as separate lines (otherwise GitHub doesn't hook them up to automation correctly).

scripts/assets/file_content_validation_checks.textproto Outdated Show resolved Hide resolved
@MohitGupta121
Copy link
Member Author

MohitGupta121 commented Feb 28, 2023

@MohitGupta121 MohitGupta121 removed their assignment Feb 28, 2023
@BenHenning BenHenning removed their assignment Mar 21, 2023
@oppiabot
Copy link

oppiabot bot commented Apr 1, 2023

Hi @MohitGupta121, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Apr 1, 2023
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Apr 2, 2023
Copy link
Member Author

@MohitGupta121 MohitGupta121 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BenHenning PTAL, Thanks.
I updated all the Regex Tests and now working for all kotlin as well as xml.
Please tell me if we need to change or update anything else.

Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MohitGupta121! This LGTM!

@BenHenning BenHenning enabled auto-merge (squash) April 6, 2023 02:39
@oppiabot oppiabot bot added the PR: LGTM label Apr 6, 2023
@oppiabot
Copy link

oppiabot bot commented Apr 6, 2023

Hi @MohitGupta121, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants