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

[Cleanup]: Fix Android Studio Warnings #13282

Open
david-allison opened this issue Feb 16, 2023 · 14 comments · Fixed by #15720, #16638 or #16740
Open

[Cleanup]: Fix Android Studio Warnings #13282

david-allison opened this issue Feb 16, 2023 · 14 comments · Fixed by #15720, #16638 or #16740
Labels
Accepted Maintainers welcome a PR implementing this feature Good First Issue! Keep Open avoids the stale bot
Milestone

Comments

@david-allison
Copy link
Member

david-allison commented Feb 16, 2023

This task is designed as a small, useful task to onboard new users to the codebase who are unsure about what to work on.

Important

Unique constraint to this issue
Multiple pull requests from the same author will not be accepted, unless the refactoring is part of a larger piece of work

Tip

You do not need to be assigned this issue to work on it

Android Studio flags a number of warnings in the AnkiDroid project.

If a file which contains these warnings is committed, then Android Studio will warn the author. If the warning was not introduced by the author's commit, then the author is unnecessarily slowed down by having to confirm that they did not introduce more warnings into the codebase (which inevitably leads them to disabling the warning, as they're low value).

The list of warnings can be obtained via:

  • Code -> Inspect Code

Screenshot 2023-02-16 at 21 38 16

The aim of this task is to introduce new contributors to the code with an 'easy' first issue to resolve.

  1. Run Code -> Inspect Code on the solution (it will be slow)
  2. Select one file which has warnings (under the Kotlin header is easiest.- many of the Java warnings are not flagged by the IDE)
  3. Fix all the errors, warnings + weak warnings in the file, automatically if this is offered by the IDE, or manually otherwise.
  4. Produce a Pull Request

If you have completed this and desire to do more work, please select one of our accepted issues, or fix some @NeedsTest annotations in the codebase.

Once this issue has been completed, we can use CI to run Android Studio in headless mode to ensure that the codebase gets to, and stays at 0 warnings.

@atakanserifoglu

This comment was marked as resolved.

@lukstbit
Copy link
Member

@atakanserifoglu Please read carefully the constraints mentioned above:

Multiple pull requests from the same author for this issue will not be accepted (this is a constraint unique to this issue).

@atakanserifoglu
Copy link

The project's naming convention has a lot of underscores whereas all of the issues related to this topic suggests camel case convention. Should I adapt all of these functions, classes and variable names or look for a different solution?

@david-allison
Copy link
Member Author

david-allison commented Feb 17, 2023

The project's naming convention has a lot of underscores whereas all of the issues related to this topic suggests camel case convention. Should I adapt all of these functions, classes and variable names or look for a different solution?

If they're in libanki, ignore + suppress naming conventions. Otherwise they're candidates to be removed

@Prachi-Jamdade

This comment was marked as resolved.

@david-allison

This comment was marked as resolved.

@deecodesss

This comment was marked as resolved.

@lukstbit lukstbit added the Accepted Maintainers welcome a PR implementing this feature label Feb 22, 2023
@lukstbit
Copy link
Member

@deekshatw and others. Go ahead, there's no need to ask for permission to work on this issue.
Follow the steps above, pick a file that you want to fix, check the active PRs list to see if that specific file doesn't already have a PR associated, make your own PR, be happy.

@Prachi-Jamdade

This comment was marked as resolved.

@david-allison

This comment was marked as resolved.

BrayanDSO pushed a commit that referenced this issue Apr 24, 2023
* Update ScopedStorageService.kt

Fixed warnings in ScopedStorageService.kt.
issue: #13282

* Removed lines in ScopedStorageService.kt

Deleted the code that was commented out.
KendallPark pushed a commit to KendallPark/Anki-Android that referenced this issue May 30, 2023
* Update ScopedStorageService.kt

Fixed warnings in ScopedStorageService.kt.
issue: ankidroid#13282

* Removed lines in ScopedStorageService.kt

Deleted the code that was commented out.
@github-actions github-actions bot added the Stale label Jun 2, 2023
@BrayanDSO BrayanDSO added Keep Open avoids the stale bot and removed Stale labels Jun 2, 2023
@TusharBhatia34

This comment was marked as resolved.

@lukstbit
Copy link
Member

lukstbit commented Aug 5, 2023

is this issue still open ?

Yes, it is. You can make a PR fixing one of the many reported issues.

@mikehardy mikehardy added this to the 2.19 release milestone May 13, 2024
henriqueccmac added a commit to henriqueccmac/Anki-Android that referenced this issue May 27, 2024
henriqueccmac pushed a commit to henriqueccmac/Anki-Android that referenced this issue May 27, 2024
…oid#13282 (ankidroid#16095)

* Fixed some Kotlin Android Studio Warnings

* Reverted import changes

* Update OperationTest.kt code legibility improved

---------

Co-authored-by: Bernardo Galante <ba@MacBook-Air-de-Bernardo.local>
@lukstbit lukstbit removed this from the 2.19 release milestone Jun 21, 2024
@github-actions github-actions bot added this to the 2.19 release milestone Jun 23, 2024
@david-allison david-allison reopened this Jun 23, 2024
@david-allison david-allison reopened this Jul 17, 2024
@mikehardy mikehardy modified the milestones: 2.19 release, 2.20 Release Aug 29, 2024
benwicks pushed a commit to benwicks/Anki-Android that referenced this issue Oct 3, 2024
benwicks added a commit to benwicks/Anki-Android that referenced this issue Oct 3, 2024
benwicks added a commit to benwicks/Anki-Android that referenced this issue Oct 3, 2024
benwicks added a commit to benwicks/Anki-Android that referenced this issue Oct 3, 2024
xenonnn4w pushed a commit to xenonnn4w/Anki-Android that referenced this issue Oct 25, 2024
@mikehardy mikehardy modified the milestones: 2.20 Release, 2.21 release Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment