-
Notifications
You must be signed in to change notification settings - Fork 615
Enabled linting on Firestore #63
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
Conversation
There are types of linting errors that seem worthy of being fixed. I have adopted some cookie cutter solution to fix two types of errors: 1) Remove usage of asserts that are unsupported in ART See: https://android.googlesource.com/platform/tools/base/+/master/lint/libs/lint-checks/src/main/java/com/android/tools/lint/checks/AssertDetector.java 2) Replace HashMaps with SparseArrays Which seemed appropriate based on a rudimentary glance. See: https://stackoverflow.com/questions/25560629/sparsearray-vs-hashmap If you feel like these replacements are appropriate, I can replace them at a bunch of more places and enable linting
Neither of these changes are really OK:
|
Is it acceptable to us that the assert statements do not actually work in the Android Runtime ? |
In principle no, but there's a trade-off to be made. Every write on the backend is going through this code so the likelihood of an android client tripping over this is miniscule. On the other side is having to avoid clobbering this with every update we get from the server. The only way to "fix" these assertions is to rewrite these in the copybara script. |
This reverts commit 8f99575.
Ok. Given that we have consciously thought through these errors, I have explicitly whitelisted these cases and in general enabled the linter. |
/test smoke-tests-debug |
/test check |
…bageCollectorTestCase.java
/test smoke-tests-release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This change whitelists errors thrown by linter that we know about and documents why these are reasonable.
We enable linter.