-
Notifications
You must be signed in to change notification settings - Fork 529
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 #4689: Add regex check to prohibit post() and postDelayed() #4900
Fix #4689: Add regex check to prohibit post() and postDelayed() #4900
Conversation
- Add regex check to prohibit the usage of post() and postDelayed() - Add tests for the regex check added
Hi @kkmurerwa, 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. |
Hey @BenHenning. I did some housekeeping here and merged the latest changes from develop. All checks were passing before the merge and should even after the merge. The failing checks just need a rerun. |
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.
Thanks @kkmurerwa! Had some follow-up thoughts, PTAL.
scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt
Show resolved
Hide resolved
…ther error message displayed is correct
PTAL @kkmurerwa |
Hey @BenHenning. I updated this PR with some new changes. They are detailed in a second section of the PR comment labeled |
PTAL @BenHenning |
- Refactor the prohibited regex to cover false positives in some files - Remove the wrongly exempted SpotlightFragment.kt file
Hey @BenHenning. A few checks failed after the last commit but it shouldn't be a problem. A quick rerun should fix it. |
@kkmurerwa Done, I re-run the CI checks. Thanks. |
Thanks @MohitGupta121 |
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.
Thanks @kkmurerwa. Took another pass--please make sure to respond to all comments before sending PRs back into review.
scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt
Show resolved
Hide resolved
scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt
Outdated
Show resolved
Hide resolved
- Rearrange the exempted files n lexicographical order. - Rename the doesNotUsePostorPostDelayed to doesNotUsePostOrPostDelayed - Modify the failure message to fix grammatical errors
@BenHenning I have responded to all unresolved comments and fixed the issues highlighted. I believe it is ready for another review. |
PTAL @BenHenning |
Unassigning @kkmurerwa since a re-review was requested. @kkmurerwa, please make sure you have addressed all review comments. Thanks! |
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.
Thanks @kkmurerwa! This LGTM!
Explanation
Fix #4689: When merged, this PR will;
The commits pushed on 4th April 2023 will;
RegexPatternValidationCheckTest.kt
to exemptions since it is matched correctly against the regex. This is an undesired side effect or removing tests from exemptions.SpotlightFragment.kt
from exemptions since it contains no instance of post() or postDelayed()post {}
instead of only matchingpost()
andpostDelayed()
.post ()
,postDelayed ()
andpost {}
.Essential Checklist
For UI-specific PRs only
If your PR includes UI-related changes, then: