Skip to content
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

dev: Lint error reports output too much #14853

Closed
david-allison opened this issue Nov 30, 2023 · 1 comment · Fixed by #14854
Closed

dev: Lint error reports output too much #14853

david-allison opened this issue Nov 30, 2023 · 1 comment · Fixed by #14854
Labels
CI Dev Development, testing & CI Lint
Milestone

Comments

@david-allison
Copy link
Member

112 lines, only ~4 are relevant

Example

/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt:2541: Information: Method all must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
val tags = ArrayList(getColUnsafe.tags.all())
~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/CardBrowser.kt:705: Information: Method getCard must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
cardBrowserCard = getColUnsafe.getCard(mCurrentCardId)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/CardBrowser.kt:1393: Information: Method all must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
val allTags = getColUnsafe.tags.all()
~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/CardBrowser.kt:1427: Information: Method all must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
getColUnsafe.tags.all()
~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/CardTemplatePreviewer.kt:307: Information: Method canonify must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
val tagsSet = currentNote.col.tags.canonify(tagsList)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/CardTemplatePreviewer.kt:337: Information: Method newNote must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
val note = col.newNote(mEditedNotetype!!).apply {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/CardTemplatePreviewer.kt:343: Information: Method clozeNumbersInNote must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
col.clozeNumbersInNote(note).indexOf(clozeNumber)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/CardTemplatePreviewer.kt:369: Information: Method newNote must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
val n = getColUnsafe.newNote(notetype)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt:970: Information: Method totalCount must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
if (getColUnsafe.sched.totalCount() == 0) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt:1160: Information: Method modSchema must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
getColUnsafe.modSchema()
~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/ModelFieldEditor.kt:215: Information: Method modSchema must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
collection.modSchema()
~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/ModelFieldEditor.kt:217: Information: Method modSchemaNoCheck must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
collection.modSchemaNoCheck()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/ModelFieldEditor.kt:246: Information: Method modSchema must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
collection.modSchema()
~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/ModelFieldEditor.kt:420: Information: Method modSchema must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
collection.modSchema()
~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/NoteEditor.kt:758: Information: Method setDeck must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
getColUnsafe.setDeck(listOf(mCurrentEditedCard!!.id), deckId)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/NoteEditor.kt:1088: Information: Method all must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
val tags = ArrayList(getColUnsafe.tags.all())
~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/NoteEditor.kt:1192: Information: Method getCard must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
mCurrentEditedCard = getColUnsafe.getCard(mCurrentEditedCard!!.id)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/NoteEditor.kt:1850: Information: Method canonify must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
getColUnsafe.tags.join(getColUnsafe.tags.canonify(mSelectedTags!!)).trim { it <= ' ' }.replace(" ", ", ")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/NoteEditor.kt:1850: Information: Method join must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
getColUnsafe.tags.join(getColUnsafe.tags.canonify(mSelectedTags!!)).trim { it <= ' ' }.replace(" ", ", ")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Previewer.kt:121: Information: Method getCard must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
currentCard = col.getCard(mCardList[mIndex])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Previewer.kt:214: Information: Method filterToValidCards must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
val newCardList = getColUnsafe.filterToValidCards(mCardList)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Previewer.kt:221: Information: Method getCard must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
currentCard = getColUnsafe.getCard(mCardList[mIndex])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Previewer.kt:234: Information: Method getCard must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
currentCard = getColUnsafe.getCard(mCardList[mIndex])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt:293: Information: Method getWhiteboardState must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
prefWhiteboard = MetaDB.getWhiteboardState(this, parentDid)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt:296: Information: Method getWhiteboardVisibility must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
val whiteboardVisibility = MetaDB.getWhiteboardVisibility(this, parentDid)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt:299: Information: Method getWhiteboardStylusState must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
toggleStylus = MetaDB.getWhiteboardStylusState(this, parentDid)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt:418: Information: Method storeWhiteboardStylusState must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
MetaDB.storeWhiteboardStylusState(this, parentDid, toggleStylus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt:718: Information: Method undoAvailable must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
undoEnabled = colIsOpenUnsafe() && getColUnsafe.undoAvailable()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt:728: Information: Method undoAvailable must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
} else if (getColUnsafe.undoAvailable()) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt:729: Information: Method undoLabel must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
undoIcon.title = getColUnsafe.undoLabel()
~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt:1256: Information: Method storeWhiteboardState must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
MetaDB.storeWhiteboardState(this, parentDid, state)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt:1332: Information: Method getWhiteboardPenColor must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
val whiteboardPenColor = MetaDB.getWhiteboardPenColor(this, parentDid).fromPreferences()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt:1362: Information: Method storeWhiteboardVisibility must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
MetaDB.storeWhiteboardVisibility(this, parentDid, state)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt:1403: Information: Method queryScalar must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
getColUnsafe.db.queryScalar(
^
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt:1417: Information: Method queryScalar must be called from the worker thread, currently inferred thread is UI thread [WrongThread]
getColUnsafe.db.queryScalar(
^
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/res/drawable/splash_icon_adaptive.xml:1: Error: The resource R.drawable.splash_icon_adaptive appears to be unused [UnusedResources]
<animated-vector
^
/Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/NavigationDrawerActivity.kt:462: Information: Calling this method indicates use of dynamic shortcuts, but there are no calls to methods that track shortcut usage, such as pushDynamicShortcut or reportShortcutUsed. Calling these methods is recommended, as they track shortcut usage and allow launchers to adjust which shortcuts appear based on activation history. Please see https://developer.android.com/develop/ui/views/launch/shortcuts/managing-shortcuts#track-usage [ReportShortcutUsage]
ShortcutManagerCompat.addDynamicShortcuts(
^
1 errors, 0 warnings

Originally posted by @david-allison in #14837 (comment)

@david-allison david-allison self-assigned this Nov 30, 2023
@david-allison david-allison added Lint Dev Development, testing & CI CI labels Nov 30, 2023
@david-allison
Copy link
Member Author

The lines:

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Are irrelevant for us.

Gradle currently (appears to) provide no means of disabling them

I don't know whether it's worthwhile to put in a feature request/PR

https://github.com/gradle/gradle/blob/0ab87d89e684493f45885327f4d83b54fc4cdec0/subprojects/core/src/main/java/org/gradle/internal/buildevents/BuildExceptionReporter.java#L342

https://github.com/gradle/gradle/blob/0ab87d89e684493f45885327f4d83b54fc4cdec0/subprojects/core/src/main/java/org/gradle/internal/buildevents/BuildExceptionReporter.java#L236-L281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Dev Development, testing & CI Lint
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant