0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 12:02:16 +02:00
Commit Graph

145 Commits

Author SHA1 Message Date
Brayan Oliveira
8f9f8c2261 Use JUnit5 on tests
1. Extract JUnit version to a constant, so all 3 testImplementations uses the same version
2. Add JUnitPlatform use to `build.gradle`
3. Fix imports to `kotlin.test.junit5.JUnit5Asserter`
4. Fix `AbstractFlashcardViewerTest.getSignalFromUrlTest`
- It is currently the only parameterized test that uses jupiter-params. It wasn't being discovered before, so it haven't raised any exception.
- Now that it's discovered, it needed to be fixed
2022-05-01 19:13:49 -05:00
David Allison
424c7ddae8 refactor: convert DirectGregorianInstantiation to Kotlin
com.ichi2.anki.lint.rules.DirectGregorianInstantiation

Moved the companion object to the top of the class to keep the diff clean
2022-04-30 12:51:07 -05:00
David Allison
2ecbde9a45 refactor: Rename DirectGregorianInstantiation.java to .kt
com.ichi2.anki.lint.rules.DirectGregorianInstantiation
2022-04-30 12:51:07 -05:00
David Allison
f0ae612e89 refactor: convert DirectDateInstantiation to Kotlin
com.ichi2.anki.lint.rules.DirectDateInstantiation

Moved the companion object to the top of the class to keep the diff clean
2022-04-30 12:25:24 -05:00
David Allison
8a22c5f83b refactor: Rename DirectDateInstantiation.java to .kt
com.ichi2.anki.lint.rules.DirectDateInstantiation
2022-04-30 12:25:24 -05:00
David Allison
080778881b refactor: convert DirectCalendarInstanceUsage to Kotlin
com.ichi2.anki.lint.rules.DirectCalendarInstanceUsage

Moved the companion object to the top of the class to keep the diff clean
2022-04-30 12:18:15 -05:00
David Allison
5cdff02329 refactor: Rename DirectCalendarInstanceUsage.java to .kt
com.ichi2.anki.lint.rules.DirectCalendarInstanceUsage
2022-04-30 12:18:15 -05:00
David Allison
70341d2188 refactor: convert CopyrightHeaderExists to Kotlin
com.ichi2.anki.lint.rules.CopyrightHeaderExists

Moved the companion object to the top of the class to keep the diff clean
2022-04-30 12:10:59 -05:00
David Allison
85997ef374 refactor: Rename CopyrightHeaderExists.java to .kt
com.ichi2.anki.lint.rules.CopyrightHeaderExists
2022-04-30 12:10:59 -05:00
David Allison
a772f12ad0 refactor: convert ConstantJavaFieldDetector to Kotlin
com.ichi2.anki.lint.rules.ConstantJavaFieldDetector
2022-04-30 11:47:20 -05:00
David Allison
60a0d007d3 refactor: Rename ConstantJavaFieldDetector.java to .kt
com.ichi2.anki.lint.rules.ConstantJavaFieldDetector
2022-04-30 11:47:20 -05:00
David Allison
f40239ddad lint: verify plural positional format strings
`%d Total cards imported: %d`

should be

`%1$d Total cards imported: %2$d`

Apply our existing code: `verifyJavaStringFormat` to
 plurals and their item elements

We also have a more complex case:
  * one (valid) plural with one non-positional element: "%s"
  * one (valid) plural with two positional elements: "%1$s, %2$s"

But together, this implies that the plural is given two strings
so the first should be positional

Fixes 11072
2022-04-29 15:36:43 -05:00
Mike Hardy
25473eeaff fix(build): lint-rules project should use common best build practices
extract our best-practices build settings to project-level file, apply
to all sub-projects

Fixes #11083
2022-04-25 22:25:52 -05:00
Mike Hardy
45e7c19f8b build(deps): lint-rules hamcrest use 2.2, extract hamcrest version
This is the recommended way to upgrade hamcrest from 1.x to 2.x when
using junit 4.x, see http://hamcrest.org/JavaHamcrest/distributables#gradle-upgrade-example
2022-04-25 22:25:52 -05:00
Mike Hardy
9de60878ba
build(deps): dependency updates 20220425
chore(deps): bump kotlin_version from 1.6.20 to 1.6.21  c275b35
chore(deps): bump mockito-inline from 4.4.0 to 4.5.0  0eee1e6
chore(deps): bump leakcanary-android from 2.7 to 2.9 (#10988)  72bede3
chore(deps): bump protobuf-java from 3.20.0 to 3.20.1  e79c835
chore(deps): bump leakcanary-android from 2.9 to 2.9.1  674c833
chore(deps): bump mockito-inline from 4.5.0 to 4.5.1  e790731
build(deps): kotlin stdlib deps are implicit now #10991
2022-04-25 11:07:21 -05:00
David Allison
b1468a2425 fix: Don't apply lint to ignored file
tools:ignore ignores the outcome, but still processed the file

This caused a bug as it found a duplicate key in an ignored file

and flagged it as an error on the non-ignored file
2022-04-24 14:56:36 -05:00
David Allison
bec3b346f1 fix: Don't apply strings lint to non-strings file
DuplicateCrowdInStrings applies to only the /values/ folder
But there are other files in the values folder aside from translatable
strings (resources, constants, etc...)

As lint does not currently have a good way to exclude files from linting
So instead we use `tools:ignore` to do this
2022-04-24 10:18:11 -05:00
David Allison
b51e99f0fd refactor: Kotlin Cleanup: DuplicateCrowdInStrings 2022-04-24 10:18:11 -05:00
David Allison
7c4bba2807 refactor: Convert DuplicateCrowdInStrings to Kotlin
com.ichi2.anki.lint.rules.DuplicateCrowdInStrings
2022-04-23 20:48:23 -05:00
David Allison
e83e696735 refactor: Rename DuplicateCrowdInStrings.java to .kt
com.ichi2.anki.lint.rules.DuplicateCrowdInStrings
2022-04-23 20:48:23 -05:00
David Allison
c16aae062a
feat: Allow Kotlin Migration on lint-rules (#11037)
* lint-rules: include kotlinMigration-lint

changes from `AnkiDroid/kotlinMigration`:

* remove `android { }` wrapper around `ktlint { }`

Due to this change, we use a new file
We use the -lint suffix to imply to reviewers that this is a different
 file type

* lint-rules: remove ANDROID_TEST from kotlinMigration
2022-04-23 16:37:36 -05:00
Mike Hardy
a70c0f6a38 fix: nonPositionalFormatSubstitution rule should use same param name as super
quiets a build warning
2022-04-23 14:32:38 -05:00
Mike Hardy
22c5da6522 fix: forward-port to non-deprecated APIs in DuplicateCrowdInStrings rule 2022-04-21 08:55:01 -05:00
Mike Hardy
10db92dbb0 chore(lint): fix lint compile warning re: missing Vendor 2022-04-20 15:34:48 +01:00
David Allison
d3e103f7fa docs: improve JUnitNullAssertionDetector message
* kotlin.test is better if we use assertNull without a message
* JUnitAsserter requires a message, meaning more change

Good to use:

https://kotlinlang.org/api/latest/kotlin.test/kotlin.test/assert-null.html
https://kotlinlang.org/api/latest/kotlin.test/kotlin.test/assert-not-null.html
https://kotlinlang.org/api/latest/kotlin.test/kotlin.test.junit/-j-unit-asserter/
2022-04-13 11:29:13 -05:00
David Allison
5da9561a29 refactor: typos & related KotlinCleanup 2022-04-07 10:27:03 -05:00
Divyansh Dwivedi
bff7e5ed3e
added New Lint rule for Detecting invalid string formats. (#10628) 2022-03-31 16:00:15 -05:00
Mike Hardy
2147589640 chore(ktlint): bump ktlint to 0.45.1 / spacing changes w/new version
spacing changes were produced automatically using the new version on the
command line with `-F` argument to auto-fix spacing to conform with new
version of the tool
2022-03-23 16:14:53 -05:00
Arthur Milchior
1d5ccb5620 NF: rename folder to directory
Simply for the sake of consistency. It will ensure that when searching for a
method, function or variable name, I have a single word to look for

This was done by a simple search and replace in .java and .kt files, preserving
case.

The only exception being org.junit.rules.TemporaryFolder and its method
`newFolder`, which obviously was not renamed.

Note that `folder` can't be entirely renamed to `directory` either because of
the class `DirectoryStream`. It seems even Java is not consistent between Folder
and directory
2022-03-14 16:12:07 +05:30
David Allison
4745b60d40 docs(copyright): Improve docs 2022-03-07 15:26:01 -05:00
David Allison
04735878ce feat(lint): Ensure use of JUnitAsserter
Adds lint to help with Kotlin migration

This removes some needs for `!!` in the code:

`assertNotNull(x)` -> `x` is now known to be non-null.

This will break lint on the "rename" commit in a Kotlin migration,
I feel this is worthwhile as otherwise the lint check would
 not be viable

https://kotlinlang.org/api/latest/kotlin.test/kotlin.test.junit/-j-unit-asserter/

Issue 10427
2022-03-05 08:30:43 -05:00
David Allison
21c5bcdc8e feat(lint): Verify Positional Format Strings
AAPT displayed these issues as build as warnings, but CI passed

Add lint to make sure this is caught.

We take AAPT's C++ code and convert it to Kotlin.

Tested on commit d392498050

Errors looks like:

AnkiDroid\src\main\res\values\04-network.xml:84:
Multiple substitutions specified in non-positional format.
Convert "%s" to "%1$s"
[NonPositionalFormatSubstitutions from com.ichi2.anki.lint]

Fixes 10347
2022-02-20 17:20:51 -05:00
Akshit Sinha
1b597dfc96 Fixed Typo in KotlinMigrationBrokenEmails 2022-02-12 07:14:07 -05:00
Akshit Sinha
29eb51518a Added a Lint Check for line-break tag issue in kotlin migration 2022-02-12 07:14:07 -05:00
Mike Hardy
b430879e54
Dependency updates 20220201 (#10296)
* Bump mockito-inline from 4.3.0 to 4.3.1

Bumps [mockito-inline](https://github.com/mockito/mockito) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v4.3.0...v4.3.1)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-inline
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* test(lint): only run default TestModes for prefer is empty check

if the extra whitespace mode runs, it perturbs the diff and the check fails

* Bump lint_version from 30.0.4 to 30.1.0

Bumps `lint_version` from 30.0.4 to 30.1.0.

Updates `lint-api` from 30.0.4 to 30.1.0

Updates `lint` from 30.0.4 to 30.1.0

Updates `lint-tests` from 30.0.4 to 30.1.0

---
updated-dependencies:
- dependency-name: com.android.tools.lint:lint-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.android.tools.lint:lint
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.android.tools.lint:lint-tests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump fragment-testing from 1.4.0 to 1.4.1

Bumps fragment-testing from 1.4.0 to 1.4.1.

---
updated-dependencies:
- dependency-name: androidx.fragment:fragment-testing
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump preference-ktx from 1.1.1 to 1.2.0

Bumps preference-ktx from 1.1.1 to 1.2.0.

---
updated-dependencies:
- dependency-name: androidx.preference:preference-ktx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* test(layout): do not attempt to inflate preference_category_material

* Bump fragment-ktx from 1.4.0 to 1.4.1

Bumps fragment-ktx from 1.4.0 to 1.4.1.

---
updated-dependencies:
- dependency-name: androidx.fragment:fragment-ktx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump protobuf-java from 3.19.3 to 3.19.4

Bumps [protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.19.3 to 3.19.4.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.19.3...v3.19.4)

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-java
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-01 08:43:44 -05:00
David Allison
14898fa14f lint: kotlin conversion corrupting emails
The Java -> Kotlin migration converts <...> into html tags
if the comment is /** instead of /*

This often catches the copyright header of files, which is bad
as it corrupts the emails in the copyright.

Pickup the email `<http:></http:>` and report this
2021-10-30 08:25:25 -05:00
David Allison
174ae14237 feat(lint-GPL): Steps for GPL compatible licenses
https://www.gnu.org/licenses/license-list.en.html#GPLCompatibleLicenses

https://softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html#x1-40002.2

Fixes 9260
2021-10-18 13:02:21 -05:00
David Allison
b0fd892c1f lint: enable 'missing copyright' on tests
Previous commits have resolved the current warnings, this stops
it from occurring for new users

Issue 9538 - enable lint warnings on tests
2021-10-09 09:40:08 -05:00
David Allison
ee962c2d19 lint: check NonPublicNonStaticFieldName in tests
Issue 9538
2021-09-22 11:00:22 -05:00
Nicola Dardanis
c6f5d3f3ea lint: Use isEmpty instead of comparing size to zero 2021-08-27 08:19:38 -05:00
Nicola Dardanis
51ac9055db lint: Avoid use of field prefixes for variable names 2021-08-27 08:15:20 -05:00
David Allison
5a951f13de lint: Only enforce variable naming in java
We want to move away from AOSP naming for Kotlin

As it makes getters and primary constructors less useful
as the naming conflicts with other policies we want to enforce
AOSP naming is also against Google suggestions

Fixes 9377
2021-08-05 21:33:20 -05:00
dependabot[bot]
a8681b3486 build(deps): bump lint_version from 27.2.2 to 30.0.0
Fix errors which were introduced:

* api is now required
* Unicode Handling changed
* Compilation errors from missing imports were introduced
  * a2d0a4ca4d

Bumps `lint_version` from 27.2.2 to 30.0.0.

Updates `lint-api` from 27.2.2 to 30.0.0

Updates `lint` from 27.2.2 to 30.0.0

Updates `lint-tests` from 27.2.2 to 30.0.0

---
updated-dependencies:
- dependency-name: com.android.tools.lint:lint-api
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: com.android.tools.lint:lint
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: com.android.tools.lint:lint-tests
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-29 13:33:45 -05:00
David Allison
619c8d0b00 nf: NonNull annotation 2021-07-09 11:13:44 -05:00
David Allison
7cf2ea7850 fix[lint]: allow Kotlin companion objects
`ConstantFieldName` lint was triggered by auto-generated Kotlin
companion objects named "Companion" (expected: COMPANION)

As these are auto-generated, allow constants called "Companion"

Fixes 9223
2021-07-09 11:13:44 -05:00
David Allison
95ddf9bdbb gradle: consolidate lint library version
Reduce GitHub notification spam (previously we get 3 update PRs)
as the library updates in lockstep

Fixes 9179
2021-07-01 13:38:23 -05:00
almas33
bc7c2b98bb Lint: Ensure Copyright Header Exists
This is a common issue in code reviews
The lint check explains how to fix the issue
so reduces review load and helps onboarding

Fixes 8359
2021-06-24 10:28:56 -05:00
David Allison
1a08c583f3 Extract Kotlin version to variable
Review comment: keeps all Kotlin modules in sync

Note: adding this to the `ext { }` section didn't work for the main
build.gradle, but would be a better solution

Using
https://stackoverflow.com/questions/64834818/android-studio-could-not-get-unknown-property-kotlin-version
2021-06-23 23:16:23 -05:00
Shridhar
4f21060f5e Use compileOnly for Kotlin dependency in lint-rules 2021-05-28 20:12:33 +02:00
Shridhar
49a98af859 Migrate UiUtil to Kotlin 2021-05-28 20:12:33 +02:00
Mike Hardy
bd37e05495
Dependency updates 20210522 (#8906)
* Bump junit-vintage-engine from 5.7.1 to 5.7.2

Bumps [junit-vintage-engine](https://github.com/junit-team/junit5) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.7.1...r5.7.2)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump fragment from 1.3.3 to 1.3.4

Bumps fragment from 1.3.3 to 1.3.4.

Signed-off-by: dependabot[bot] <support@github.com>

* Bump fragment-testing from 1.3.3 to 1.3.4

Bumps fragment-testing from 1.3.3 to 1.3.4.

Signed-off-by: dependabot[bot] <support@github.com>

* Bump annotations from 20.1.0 to 21.0.0

Bumps [annotations](https://github.com/JetBrains/java-annotations) from 20.1.0 to 21.0.0.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/20.1.0...21.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

* chore(dependencies): bump appcompat (rc01->stable) and some test only deps

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-22 12:19:03 -05:00
Arthur Milchior
6c0d3b77fa NF: remove JetBrains Nullable 2021-05-22 09:28:39 -05:00
Arthur Milchior
dcbed8f5cf NF: remove jetbrains NotNull 2021-05-22 09:28:39 -05:00
Mike Hardy
9c90cc52e5
Dependency updates 20210514 (#8840)
* Bump lint-api from 27.2.0 to 27.2.1
* Bump lint-tests from 27.2.0 to 27.2.1
* Bump gradle from 4.2.0 to 4.2.1
* Bump lint from 27.2.0 to 27.2.1
* Bump jackson-databind from 2.12.0 to 2.12.3
* Bump protobuf-java from 3.15.8 to 3.17.0
2021-05-14 17:42:59 -05:00
Mike Hardy
49edb49e17 build: android-gradle-plugin 4.2.0 + others
- remove jcenter (deprecated, thankfully no longer needed)
- remove r8 workaround for previous issue, AGP 4.2.0 has fix built-in
- bump Triple-T / Play Publisher plugin to match AGP 4.2.0
- remove java 1_8 source/target compat annotation, it is default in 4.2
- add noinspection for commons-compress - has to wait until API26
- lint to 27.2.0
- fragment to 1.2.3
2021-05-07 17:16:00 -05:00
David Allison
5fbb8801e8 docs: improve lint error
Was ambiguous about adding the attribute to just one string
2021-04-26 05:02:29 +02:00
Prateek Singh
11667f9de6 Updated Fixed Title length lint rule 2021-04-24 02:38:37 +02:00
Mike Hardy
61cb6c3f05 Update to gradle 7.0
- API publishing needed a complete overhaul, tested locally, works
- JCenter is still needed for AnkiDroid as noted unfortunately...couple months to go
- Some artifact resolution performance complaints but local testing shows every single thing works
2021-04-15 23:21:34 -05:00
Mrudul Tora
557eff4dc8
Lint: Lint rule for use of UIUtils.showSnackbar instead of Snackbar.make (#8625)
* Added lint rule for use of UIUtils.showSnackbar instead of Snackbar.make
* Fixed the lint errors related to Snackbar.make
* Fixed inconsistent spacing

Co-authored-by: David Allison <62114487+david-allison-1@users.noreply.github.com>
2021-04-15 22:44:46 -05:00
David Allison
3541c210d8 Add lint rule to enforce constant field naming
For: `public static final` variables

Lint Id: ConstantFieldName

Automation: Means that we don't need to enforce this in code reviews

Constant (final variables) names must be all uppercase using underscore
 to separate words.

https://github.com/ankidroid/Anki-Android/wiki/Code-style#constant-final-variables-names-must-be-all-uppercase-using-underscore-to-separate-words

Note: The wording is imprecise: so only flag public constants
2021-04-14 12:43:52 -05:00
David Allison
f1e37dc557 Add lint rule to enforce 'm' variable prefix
For: Non-Static, Non-Public variables

Lint Id: NonPublicNonStaticFieldName

Automation: Means that we don't need to enforce this in code reviews

https://github.com/ankidroid/Anki-Android/wiki/Code-style#non-public-non-static-field-names-should-start-with-m
2021-04-14 12:43:52 -05:00
Nicola Dardanis
901260bed6 lint: Reorder rules lexicographically in IssueRegistry 2021-04-14 11:15:14 -05:00
Nicola Dardanis
f8135927d1 lint: Add DirectToastMakeTextUsage rule 2021-04-14 11:15:14 -05:00
David Allison
89a7679839 Add lint rule: PrintStackTraceUsage
Speed up code review by ensuring that e.printStackTrace() isn't used

Also includes AnkiDroid's first "Auto-Fix" for lint
2021-04-08 10:08:22 -05:00
dependabot-preview[bot]
b7537af36a Bump lint-api from 27.1.2 to 27.1.3
Bumps lint-api from 27.1.2 to 27.1.3.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Bump lint-tests from 27.1.2 to 27.1.3

Bumps lint-tests from 27.1.2 to 27.1.3.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Bump lint from 27.1.2 to 27.1.3 (#303)

* Bump lint from 27.1.2 to 27.1.3

Bumps lint from 27.1.2 to 27.1.3.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Update lint-rules/build.gradle

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Mike Hardy <github@mikehardy.net>
2021-03-19 15:31:02 -05:00
Mike Hardy
fdf12ea82d
Dependency updates 20210302 (#8135)
* Bump junit from 4.13.1 to 4.13.2

Bumps [junit](https://github.com/junit-team/junit4) from 4.13.1 to 4.13.2.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.13.1...r4.13.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump protobuf-java from 3.14.0 to 3.15.1

Bumps [protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.14.0 to 3.15.1.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.14.0...v3.15.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump mockito-inline from 3.7.7 to 3.8.0

Bumps [mockito-inline](https://github.com/mockito/mockito) from 3.7.7 to 3.8.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.7.7...v3.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump protobuf-java from 3.15.1 to 3.15.2

Bumps [protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.15.1 to 3.15.2.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.15.1...v3.15.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump protobuf-java from 3.15.2 to 3.15.3

Bumps [protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.15.2 to 3.15.3.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.15.2...v3.15.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-02 11:35:18 -05:00
Mike Hardy
a25cb062a4
Dependency updates 20210120 (#8029)
* Bump mockito-inline from 3.6.28 to 3.7.0

Bumps [mockito-inline](https://github.com/mockito/mockito) from 3.6.28 to 3.7.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.6.28...v3.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump mockito-inline from 3.7.0 to 3.7.7

Bumps [mockito-inline](https://github.com/mockito/mockito) from 3.7.0 to 3.7.7.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.7.0...v3.7.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump gradle from 4.1.1 to 4.1.2

Bumps gradle from 4.1.1 to 4.1.2.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump lint-tests from 27.1.1 to 27.1.2

Bumps lint-tests from 27.1.1 to 27.1.2.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump sqlite-android from 3.33.0 to 3.34.0

Bumps [sqlite-android](https://github.com/requery/sqlite-android) from 3.33.0 to 3.34.0.
- [Release notes](https://github.com/requery/sqlite-android/releases)
- [Changelog](https://github.com/requery/sqlite-android/blob/master/CHANGELOG.md)
- [Commits](https://github.com/requery/sqlite-android/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump lint-api from 27.1.1 to 27.1.2

Bumps lint-api from 27.1.1 to 27.1.2.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump lint to 27.1.2 to match other lint artifacts

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-20 10:03:14 -05:00
David Allison
db82ab008a InconsistentAnnotationUsage: Improve Explanation
There is also a hierarchy in the inspections panel.
Display this so the developer can find it in the list without the search

Improves on 7020
2020-12-29 11:42:50 -05:00
David Allison
220bf39aaa Duplicate CrowdIn Strings: Automate PR Step
Now handled by code, +1 for automation

Fixed by: 7582
2020-11-20 07:46:54 -05:00
David Allison
1543f0f900 Duplicate CrowdIn Strings: Cleanup
Kill some dead code, and add quotes for console output.

Related: 7582
2020-11-20 07:46:54 -05:00
David Allison
1eab35e040 Duplicate CrowdIn Strings: Explain fixes
Explained user should add a comment attribute if the change is legit

Related: 7582
2020-11-20 07:46:54 -05:00
David Allison
6caf7a9be6 Duplicate CrowdIn Strings: Allow str with comment
If all instances of a string have comments - ignore it.

Related: 7582
2020-11-20 07:46:54 -05:00
David Allison
c51bbc004f NF: Duplicate CrowdIn Strings - Invert if
Massive improvement in readability

Related: 7582
2020-11-20 07:46:54 -05:00
David Allison
4c140c6f24 Duplicate CrowdIn Strings: Ignore translated
We only want to check and warn for duplicates in our new strings

Related: 7582
2020-11-20 07:46:54 -05:00
David Allison
60b7c8ec1d Add DuplicateCrowdInStrings lint check
Converted from Kotlin to Java from AOSP

Convert: StringCasingDetector.kt to java
Use methods from: StringFormatDetector.java

Related: 7582
2020-11-20 07:46:54 -05:00
Mike Hardy
54bb9c96f9 Bump main lint dependency to 27.1.1 to match lint sub-dependencies 2020-11-11 14:12:53 -05:00
dependabot-preview[bot]
3d28e9d5d4 Bump lint from 27.1.0 to 27.1.1
Bumps lint from 27.1.0 to 27.1.1.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-11 14:12:53 -05:00
dependabot-preview[bot]
6543c39231 Bump lint-api from 27.1.0 to 27.1.1
Bumps lint-api from 27.1.0 to 27.1.1.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-11 14:12:53 -05:00
dependabot-preview[bot]
9af6693fb5 Bump lint-tests from 27.1.0 to 27.1.1
Bumps lint-tests from 27.1.0 to 27.1.1.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-11 14:12:53 -05:00
dependabot-preview[bot]
a922f16eb6 Bump lint from 27.0.2 to 27.1.0
Bumps lint from 27.0.2 to 27.1.0.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-14 16:21:41 -05:00
dependabot-preview[bot]
0821379bb5 Bump lint-tests from 27.0.2 to 27.1.0
Bumps lint-tests from 27.0.2 to 27.1.0.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-14 06:06:10 -05:00
dependabot-preview[bot]
dd0aa075cd Bump lint from 27.0.2 to 27.1.0
Bumps lint from 27.0.2 to 27.1.0.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-14 06:06:10 -05:00
dependabot-preview[bot]
28aadadab9 Bump junit from 4.13 to 4.13.1
Bumps [junit](https://github.com/junit-team/junit4) from 4.13 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.13...r4.13.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-14 06:06:10 -05:00
dependabot-preview[bot]
8dbf0e2a85 Bump lint from 27.0.1 to 27.0.2
Bumps lint from 27.0.1 to 27.0.2.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-14 06:06:10 -05:00
dependabot-preview[bot]
c48d592fee Bump lint-api from 27.0.1 to 27.0.2
Bumps lint-api from 27.0.1 to 27.0.2.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-07 15:09:22 -05:00
dependabot-preview[bot]
cc5b3a5e59 Bump lint-tests from 27.0.1 to 27.0.2
Bumps lint-tests from 27.0.1 to 27.0.2.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-07 15:09:22 -05:00
Arthur Milchior
500b954689 NF: Remove warning about unanotated language 2020-09-30 22:10:22 -05:00
lukstbit
d6de360fac Add DuplicateTextInPreferencesXml lint check 2020-09-28 08:35:30 -05:00
Arthur Milchior
4935ac517d NF: Sort imports 2020-09-23 11:19:42 -05:00
Arthur Milchior
1f785c1b8c NF: Remove warning about parameter that could be final 2020-09-23 11:08:06 -05:00
Arthur Milchior
9892bea706 NF: ignore BooleanMethodIsAlwaysInverted
Those warning makes a lot of sens, but it would lead to "isForbidden" instead of "isAuthorized" which makes little sens
in practice
2020-09-21 09:18:12 -05:00
David Allison
da5968ec39 Add lint check: Use of JetBrains annotations
We have standardised on androidx annotations, this helps new users and suggests
an IDE option to change to the correct library.

This does appear in the IDE, so we can define it as an error, rather than a warning.
2020-09-04 12:21:24 -05:00
lukstbit
1eea5d7126 Allow dates created with long time 2020-08-30 18:24:56 -05:00
lukstbit
018c1db71f Update severity for time related lint violations 2020-08-30 18:24:56 -05:00
lukstbit
de3f38ee37 Add lint checks for new time api 2020-08-25 10:04:26 +02:00