apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Fix Lint errors/warnings

Open nicolas-raoul opened this issue 9 years ago • 26 comments

There are 407 currently. It would be good to solve them little by little.

nicolas-raoul avatar Jul 11 '16 14:07 nicolas-raoul

which lint tool are you using? Can it be run on Travis-CI?

jayvdb avatar Jul 12 '16 07:07 jayvdb

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?

nicolas-raoul avatar Jul 12 '16 07:07 nicolas-raoul

Also Codacy picks up on a lot of things like this too. In Android Studio they're generally marked with a pale yellow highlight.

domdomegg avatar Mar 08 '17 12:03 domdomegg

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

neslihanturan avatar Mar 10 '17 16:03 neslihanturan

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.

misaochan avatar Mar 10 '17 16:03 misaochan

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.

veyndan avatar Mar 10 '17 21:03 veyndan

If this is still open, I'd be happy to help with this.

loisgh avatar Sep 27 '17 00:09 loisgh

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!

noloman avatar Feb 07 '18 08:02 noloman

Yep, while there are issues on Codacy and found by Android Studio, there are.

Thanks for helping out :)

domdomegg avatar Feb 07 '18 10:02 domdomegg

I'm going to put some work into this issue

Moseco avatar Feb 12 '18 13:02 Moseco

@Moseco go ahead; please let us know if you need some help with anything

noloman avatar Feb 12 '18 13:02 noloman

Hey ! Last commit is about a week ago, are there some errors I can try to fix ?

SylvainGirod avatar Mar 01 '18 21:03 SylvainGirod

Sure @SylvainGirod. Simply run the ./gradlew :app:lint task on this project and gradle will give you a list of existing lint issues. :)

maskaravivek avatar Mar 01 '18 21:03 maskaravivek

Can I try to solve some of the current issues?

Yahhi avatar Mar 20 '18 23:03 Yahhi

Sure @Yahhi we have lots of them:)

neslihanturan avatar Mar 21 '18 07:03 neslihanturan

Hi, i'd like to help out as well.

codepixely avatar Apr 01 '18 12:04 codepixely

Taking this up. SonarLint shows 643 issues in 146 files. Should be finished by this Friday.

smnsandeep avatar Nov 05 '18 08:11 smnsandeep

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.

smnsandeep avatar Nov 13 '18 07:11 smnsandeep

hi, are there any more lint issues to work on!! I would really like to contribute.

nikhilagrawal2000 avatar Jan 14 '19 17:01 nikhilagrawal2000

@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.

domdomegg avatar Jan 14 '19 17:01 domdomegg

Hi, I would like to solve some of the lint errors!

RonakLakhotia avatar Jan 27 '19 08:01 RonakLakhotia

Reopening as believe GitHub closed automatically as was mentioned in a PR.

domdomegg avatar Mar 02 '19 16:03 domdomegg

Are there still lint issues to be fixed?

JasonSarwar avatar Oct 05 '19 04:10 JasonSarwar

Almost certainly, see https://developer.android.com/studio/write/lint#manuallyRunInspections for instructions on how to find them

domdomegg avatar Oct 05 '19 10:10 domdomegg

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.

JasonSarwar avatar Oct 13 '19 01:10 JasonSarwar

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.

fejd avatar Oct 05 '20 21:10 fejd