[BUG] Lint reports an error
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4.2k
- Forks
- 3.1k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 7
Description
I guess you don't run lint during the pull request pipeline, otherwise you would see during
./gradlew :owncloudApp:lintDebug
this
Lint found 1 errors, 847 warnings. First failure:/Users/hannes/git/owncloud-android/owncloudApp/src/main/java/com/owncloud/android/extensions/FragmentExt.kt:89: Error: Wrong usage of repeatOnLifecycle from ManageAccountsDialogFragment.onStart. [RepeatOnLifecycleWrongUsage from androidx.lifecycle]
repeatOnLifecycle(lifecycleState) {
^Explanation for issues of type "RepeatOnLifecycleWrongUsage": The repeatOnLifecycle APIs should be used when the View is created, that is in the onCreate lifecycle method for Activities, or onViewCreated in case you're using Fragments. Vendor: Android Open Source Project Identifier: androidx.lifecycle Feedback: https://issuetracker.google.com/issues/new?component=413132
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run ./gradlew :owncloudApp:lintDebug and inspect owncloudApp/src/main/java/com/owncloud/android/extensions/FragmentExt.kt around line 89, where ManageAccountsDialogFragment.onStart uses repeatOnLifecycle. Align that usage with the lint guidance for lifecycle placement, then rerun the lint task and confirm the RepeatOnLifecycleWrongUsage error is gone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100