Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

For #11397 - Add lint rule for AppCompatResources instead of ContextCompat #16011

Merged
merged 7 commits into from
Oct 20, 2020
Merged

For #11397 - Add lint rule for AppCompatResources instead of ContextCompat #16011

merged 7 commits into from
Oct 20, 2020

Conversation

juan-goncalves
Copy link
Contributor

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@juan-goncalves juan-goncalves requested review from a team as code owners October 18, 2020 22:20
@firefoxci-taskcluster
Copy link

No Taskcluster jobs started for this pull request
The `allowPullRequests` configuration for this repository (in `.taskcluster.yml` on the
default branch) does not allow starting tasks for this pull request.

@gabrielluong gabrielluong added the needs:review PRs that need to be reviewed label Oct 19, 2020
@@ -15,6 +15,7 @@ dependencies {

testImplementation "com.android.tools.lint:lint:${Versions.android_lint_api}"
testImplementation "com.android.tools.lint:lint-tests:${Versions.android_lint_api}"
testImplementation 'junit:junit:4.12'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just do testImplementation Deps.junitApi (Just pulled this into #16041 to make sure the other license tests can run)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!
I checked out the Versions object and it had JUnit 5 so I went for the hardcoded version (definitely expecting a review comment), didn't check the Deps object though

I'll update it to testImplementation Deps.junitApi then :)

@@ -0,0 +1,159 @@
package org.mozilla.fenix.lintrules
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - license (haha maybe the linter would have caught this :P )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh lol, I missed it (I guess I don't see the top of my files often haha)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I'm not getting the LicenseDetector warning on test files, maybe there's something I need to configure?

Copy link
Contributor

@ekager ekager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 nits!

@juan-goncalves
Copy link
Contributor Author

Done! @ekager

Copy link
Contributor

@ekager ekager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! :)

@ekager
Copy link
Contributor

ekager commented Oct 20, 2020

So looks like there are 6 lint errors where we are using the wrong thing here - would you mind fixing those here too? :)

@juan-goncalves
Copy link
Contributor Author

Of course, just fixed those 6 calls (reported by the linter) :)
@ekager

@codecov-io
Copy link

Codecov Report

Merging #16011 into master will not change coverage.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #16011   +/-   ##
=========================================
  Coverage     29.86%   29.86%           
+ Complexity     1191     1190    -1     
=========================================
  Files           453      453           
  Lines         18535    18535           
  Branches       2407     2407           
=========================================
  Hits           5535     5535           
  Misses        12606    12606           
  Partials        394      394           
Impacted Files Coverage Δ Complexity Δ
.../java/org/mozilla/fenix/browser/BrowserFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...onents/tips/providers/MasterPasswordTipProvider.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...brary/recentlyclosed/RecentlyClosedFragmentView.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...a/org/mozilla/fenix/search/SearchDialogFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...a/fenix/browser/readermode/ReaderModeController.kt 100.00% <100.00%> (ø) 0.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c941bd9...e7c3668. Read the comment docs.

@ekager
Copy link
Contributor

ekager commented Oct 20, 2020

Looks good, let's land it!

@ekager ekager merged commit eb0712d into mozilla-mobile:master Oct 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs:review PRs that need to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants