Fix Lint errors/warnings
There are 407 currently. It would be good to solve them little by little.
which lint tool are you using? Can it be run on Travis-CI?
I am using ./gradlew build, which includes Lint.
Current report: lint.zip
Setting up Travis-CI would be great indeed :-) Do you know any server we can use?
Also Codacy picks up on a lot of things like this too. In Android Studio they're generally marked with a pale yellow highlight.
I am fixing some of them, but there is several, which commit style do you like:
- A commit per fix
- A commit for all fixes done
I'm okay with any commit style as long as they all go into one PR. Personally though, I would go for the middle, with several fixes per commit (say, one commit for each package?). That way if you need to make any changes, you can just revert the relevant commit rather than having to redo everything.
Instead of having to rebuild the project each time, the command ./gradlew lint will run lint exclusively which should be faster than running ./gradlew build (source).
Also as a side note, saying that there are 407 lint issues found isn't extremely meaningful as it depends on how strict you've set up your lint inspections to be (i.e. via Preferences > Editor > Inspections). As I've turned on most of them, I get 544 issues found. I've mainly made this comment in case someone does make a PR and when running the lint task the number of issues doesn't seem to have changed, as they may have fixed the issues with an inspection that you aren't currently running.
If this is still open, I'd be happy to help with this.
Hi! I'd like to help with this as a way of getting to know the app for future contributions. Is this issue still open and valid? Thanks!
Yep, while there are issues on Codacy and found by Android Studio, there are.
Thanks for helping out :)
I'm going to put some work into this issue
@Moseco go ahead; please let us know if you need some help with anything
Hey ! Last commit is about a week ago, are there some errors I can try to fix ?
Sure @SylvainGirod. Simply run the ./gradlew :app:lint task on this project and gradle will give you a list of existing lint issues. :)
Can I try to solve some of the current issues?
Sure @Yahhi we have lots of them:)
Hi, i'd like to help out as well.
Taking this up. SonarLint shows 643 issues in 146 files. Should be finished by this Friday.
There are many errors which needs further understanding of data flow. Will continue fixing it as I contribute more here. Raised PR #1994 meanwhile with 50 or so fixes.
hi, are there any more lint issues to work on!! I would really like to contribute.
@nikhilagrawal2000 Yes there are plenty! Please do get stuck in. I'd advise to submit multiple smaller PRs to minimize the number of merge conflicts. Feel free to request a review from me for lint issue fixes.
Hi, I would like to solve some of the lint errors!
Reopening as believe GitHub closed automatically as was mentioned in a PR.
Are there still lint issues to be fixed?
Almost certainly, see https://developer.android.com/studio/write/lint#manuallyRunInspections for instructions on how to find them
Opened one pull request for changes to the packages:
- fr.free.nrw.commons.bookmarks
- fr.free.nrw.commons.bookmarks.locations
- fr.free.nrw.commons.bookmarks.pictures
- fr.free.nrw.commons.category
I'll work on more fixes and submit them in other pull requests.
Just ran lint and got 1065 issues. To stop the inflow of new issues I'd suggest adding a lint baseline (https://developer.android.com/studio/write/lint#snapshot), and then fail builds that introduce new issues.