Arthur Milchior
c7376f63b6
NF: remove custom json
...
it was only required to avoid checked exception. Thanks to Kotlin, it's not a
concern anymore!
2022-10-13 12:23:30 -05:00
curche
c8ea3766b0
Refactor LintUtils.isAnAllowedClass
to not use var
2022-10-12 20:15:53 +03:00
Potatoboy9999
6d9e8c7290
Replace usages of String.format in with string templating ( #12555 )
...
* Replace usages of String.format in with string templating
* Remove forgotten test code
2022-10-03 00:58:59 +05:30
lukstbit
380715b69f
Add copyright to the initial lint rules and the related classes
2022-09-15 14:19:17 +01:00
David Allison
512c86eb8a
chore: remove redundant '@JvmField' annotations
...
We're no longer in Java, so only a few annotations are still necessary.
These are mostly test methods (`@Parameter/@Rule`),
This is a potentially flaky commit, hopefully the reduction in code causes a reduction in compile times
It did not modify the API project public classes
2022-09-09 13:16:30 -03:00
David Allison
3e07d87ff8
chore: remove redundant '@JvmStatic' annotations
...
We're no longer in Java, so only a few annotations are still necessary.
These are mostly test methods (`@Parameters/@MethodSource`),
a few which are useful for mocks, and a small number which cause tests
to fail if they're removed for no reasonable reason
This is a potentially flaky commit, hopefully the reduction in
code causes a reduction in compile times
This was a mostly automated process, adding comments manually
if removing the annotation failed tests
It did not modify the API project public classes
2022-09-06 08:21:31 -05:00
David Allison
8afed86adf
chore: remove Java NonNull/Nullable references
...
* Remove `InconsistentAnnotationUsage` + Tests
* Remove unnecessary `@NonNull` and `@Nullable` annotations
No longer needed as everything is in Kotlin
2022-09-05 00:34:28 +02:00
David Allison
bf52f14176
chore: remove JavaFieldNamingPatternDetector
...
reason: No more Java in project
* (Java)NonPublicNonStaticJavaFieldDetector:
- Lint: NonPublicNonStaticFieldName
* ConstantJavaFieldDetector:
- Lint: ConstantFieldName
2022-09-05 00:34:28 +02:00
David Allison
b9b82c4cd1
chore: remove PreferIsEmptyOverSizeCheck
...
No more Java in project
PreferIsEmptyOverSizeCheck is now an IDE Lint
2022-09-05 00:34:28 +02:00
David Allison
8cfc39b850
lint: fix IDE Lint
...
Handle 'KotlinCleanup'
2022-08-19 07:19:09 -05:00
David Allison
0020421dbc
deps: Remove 'java' from lint-rules
...
No Java files exist in lint-rules so we no longer need this
2022-08-19 07:19:09 -05:00
David Allison
ab84324548
refactor: Convert InconsistentAnnotationUsageTest to Kotlin
...
com.ichi2.anki.lint.rules.InconsistentAnnotationUsageTest
2022-08-18 21:52:12 -05:00
David Allison
2947fd91a5
refactor: Rename InconsistentAnnotationUsageTest.java to .kt
...
com.ichi2.anki.lint.rules.InconsistentAnnotationUsageTest
2022-08-18 21:52:12 -05:00
David Allison
2aebc86a51
refactor: Convert JavaConstantFieldDetectorTest to Kotlin
...
com.ichi2.anki.lint.rules.JavaConstantFieldDetectorTest
2022-08-18 21:50:42 -05:00
David Allison
98964081e0
refactor: Rename JavaConstantFieldDetectorTest.java to .kt
...
com.ichi2.anki.lint.rules.JavaConstantFieldDetectorTest
2022-08-18 21:50:42 -05:00
David Allison
57fefb71ec
refactor: Convert JavaNonPublicNonStaticFieldDetectorTest to Kotlin
...
com.ichi2.anki.lint.rules.JavaNonPublicNonStaticFieldDetectorTest
2022-08-18 21:49:05 -05:00
David Allison
cae34cbfaa
refactor: Rename JavaNonPublicNonStaticFieldDetectorTest.java to .kt
...
com.ichi2.anki.lint.rules.JavaNonPublicNonStaticFieldDetectorTest
2022-08-18 21:49:05 -05:00
David Allison
7eedb3fff3
refactor: Convert PreferIsEmptyOverSizeCheckTest to Kotlin
...
com.ichi2.anki.lint.rules.PreferIsEmptyOverSizeCheckTest
2022-08-18 21:47:29 -05:00
David Allison
d15f54d02b
refactor: Rename PreferIsEmptyOverSizeCheckTest.java to .kt
...
com.ichi2.anki.lint.rules.PreferIsEmptyOverSizeCheckTest
2022-08-18 21:47:29 -05:00
David Allison
dce6f40ced
refactor: Convert PrintStackTraceUsageTest to Kotlin
...
com.ichi2.anki.lint.rules.PrintStackTraceUsageTest
2022-08-18 21:46:23 -05:00
David Allison
b8f373eba7
refactor: Rename PrintStackTraceUsageTest.java to .kt
...
com.ichi2.anki.lint.rules.PrintStackTraceUsageTest
2022-08-18 21:46:23 -05:00
Arthur Milchior
599bcebfb0
NF: Conversion to nullable, then non null simplified
2022-08-18 20:14:12 -05:00
oakkitten
0cf4ff0b7b
Streamline snackbar creation
...
This changes the way snackbars are created. Instead of calling a
function with many arguments, the new methods consistently only take
text, duration, and a builder block--whether it is called on an
activity or a view. I chose builder pattern instead of call chaining as
it makes sure that the snackbar is actually shown in the end.
Note that if showSnackbar is called on an Activity that does not have a
view with id root_layout--which does not allow proper placing and
interaction with snackbars--a runtime exception will be intentionally
thrown in a debug build. Release builds will show a toast with the
contents of the snackbar instead.
Some durations were changed, notably, Card browser's snackbar that allow
searching in all decks now stay until dismissed. This is something user
may want to do at any time later; and if the snackbar is in the way,
they can dismiss it by swiping.
In com.ichi2.anki.CoroutineHelpersKt.launchCatchingTask, a few unrelated
to this change TODO comments were added.
2022-08-18 13:36:36 -05:00
Brayan Oliveira
cd0ba35a9e
lint: add rule to avoid hardcoded keys on preferences
2022-08-18 07:15:18 +03:00
Prateek Singh
1b8370a1f5
Converted FixedPreferencesTitleLengthTest[LINT TEST] to Kotlin
2022-07-07 20:12:20 +01:00
Prateek Singh
b26f12f522
Rename .java to .kt
2022-07-07 20:12:20 +01:00
lukstbit
0b58a8e624
Migrate DuplicateTextInPreferencesXmlTest.java to kotlin
2022-06-29 00:26:33 +05:30
lukstbit
47898a21f0
Rename DuplicateTextInPreferencesXmlTest.java to .kt
2022-06-29 00:26:33 +05:30
David Allison
34e734572d
refactor: convert DirectToastMakeTextUsageTest to Kotlin
...
com.ichi2.anki.lint.rules.DirectToastMakeTextUsageTest
2022-06-28 16:49:31 +01:00
David Allison
eddc6bfab4
refactor: Rename DirectToastMakeTextUsageTest.java to .kt
...
com.ichi2.anki.lint.rules.DirectToastMakeTextUsageTest
2022-06-28 16:49:31 +01:00
David Allison
eed19989f1
refactor: convert DuplicateCrowdInStringsTest to Kotlin
...
com.ichi2.anki.lint.rules.DuplicateCrowdInStringsTest
2022-06-28 16:49:24 +01:00
David Allison
e0f782cd07
refactor: rename DuplicateCrowdInStringsTest.java to .kt
...
com.ichi2.anki.lint.rules.DuplicateCrowdInStringsTest
2022-06-28 16:49:24 +01:00
Prateek Singh
e2514007f8
Converted DirectSnackbarMakeUsageTest [Lint Test] to Kotlin
2022-06-25 15:02:46 +01:00
Prateek Singh
8b782cbabd
Rename DirectDateInstantiation .java to .kt
2022-06-25 15:02:46 +01:00
David Allison
0381ddfd42
refactor: Convert DirectSystemCurrentTimeMillisUsageTest to Kotlin
...
com.ichi2.anki.lint.rules.DirectSystemCurrentTimeMillisUsageTest
2022-06-24 07:22:53 +03:00
David Allison
1aa89c1e25
refactor: Rename DirectSystemCurrentTimeMillisUsageTest to .kt
...
com.ichi2.anki.lint.rules.DirectSystemCurrentTimeMillisUsageTest
2022-06-24 07:22:53 +03:00
David Allison
9ae2322f03
refactor: Convert DirectSystemTimeInstantiationTest to Kotlin
...
com.ichi2.anki.lint.rules.DirectSystemTimeInstantiationTest
2022-06-24 06:59:24 +03:00
David Allison
f1e43eba29
refactor: rename DirectSystemTimeInstantiationTest to .kt
...
com.ichi2.anki.lint.rules.DirectSystemTimeInstantiationTest
2022-06-24 06:59:24 +03:00
Prateek Singh
3a4ec5a091
Converted DirectGregorianInstantiationTest [Lint Test] to Kotlin
2022-06-07 18:47:29 +01:00
Prateek Singh
9b657b7cd2
Rename .java to .kt
2022-06-07 18:47:29 +01:00
Nishant
b639f46518
Replaced String.format in FixedPreferencesTitleLength
...
Signed-off-by: Nishant <getrooted0019@hotmail.com>
2022-06-05 13:57:36 -05:00
Prateek Singh
2048b4dac1
Converted DirectDateInstantiationTest [Lint Test] to Kotlin
2022-05-31 23:22:06 +02:00
Prateek Singh
dbda37a8aa
Rename .java to .kt
2022-05-31 23:22:06 +02:00
Prateek Singh
2cd449e284
Converted DirectCalendarInstanceUsageTest [Lint Test] to Kotlin
2022-05-26 16:54:13 +02:00
Prateek Singh
c8904fb919
Rename .java to .kt
2022-05-26 16:54:13 +02:00
Prateek Singh
419bf6f18c
Migrate CopyrightHeaderExistsTest [Lint Test] to Kotlin
2022-05-18 11:08:26 -05:00
Prateek Singh
601821b47a
Rename .java to .kt
2022-05-18 11:08:26 -05:00
Mike Hardy
87b5df56a2
lint: fix rule for constant detection
...
appears to interact poorly with new AGP7.2
2022-05-17 13:15:55 -05:00
David Allison
e136d85362
docs: better explain cleanup annotation
2022-05-11 05:02:32 +01:00
David Allison
853d76de7d
refactor: kotlin cleanup - documentation fix
...
No semicolons in Kotlin
2022-05-11 05:02:32 +01:00