From 437b188fe8e4c34022a6c71630fa1cea1234ae8b Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Fri, 16 Jun 2023 12:11:13 -0400 Subject: [PATCH] Bug 1838903 - Fix Fenix formatting issues and update baseline --- .../java/org/mozilla/fenix/ui/BookmarksTest.kt | 2 -- .../java/org/mozilla/fenix/ui/DownloadTest.kt | 2 +- .../java/org/mozilla/fenix/ui/HistoryTest.kt | 2 -- .../java/org/mozilla/fenix/ui/HomeScreenTest.kt | 2 -- .../java/org/mozilla/fenix/ui/MediaNotificationTest.kt | 2 -- .../java/org/mozilla/fenix/ui/NavigationToolbarTest.kt | 1 - .../java/org/mozilla/fenix/ui/SettingsAboutTest.kt | 2 -- .../java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt | 2 -- .../fenix/ui/SettingsDeleteBrowsingDataOnQuitTest.kt | 1 - .../mozilla/fenix/ui/SettingsDeleteBrowsingDataTest.kt | 1 - .../org/mozilla/fenix/ui/SettingsDeveloperToolsTest.kt | 2 -- .../java/org/mozilla/fenix/ui/SettingsGeneralTest.kt | 1 - .../java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt | 2 -- .../java/org/mozilla/fenix/ui/SettingsSyncTest.kt | 2 -- .../androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt | 2 +- .../java/org/mozilla/fenix/ui/TabbedBrowsingTest.kt | 1 - .../java/org/mozilla/fenix/ui/ThreeDotMenuMainTest.kt | 2 -- .../java/org/mozilla/fenix/ui/robots/BrowserRobot.kt | 6 +++--- .../java/org/mozilla/fenix/ui/robots/SettingsRobot.kt | 6 ++---- .../java/org/mozilla/fenix/ui/robots/TabDrawerRobot.kt | 6 ++---- .../fenix/collections/CollectionCreationView.kt | 10 +++++----- .../java/org/mozilla/fenix/components/FenixSnackbar.kt | 2 +- .../components/TrackingProtectionPolicyFactory.kt | 4 ++-- .../fenix/components/history/PagedHistoryProvider.kt | 2 +- .../mozilla/fenix/compose/ClickableSubstringLink.kt | 4 ++-- .../org/mozilla/fenix/perf/AppStartReasonProvider.kt | 4 ++-- .../fenix/settings/about/AboutLibrariesFragment.kt | 2 +- .../dialog/CookieBannerReEngagementDialog.kt | 2 +- .../org/mozilla/fenix/share/SaveToPDFMiddleware.kt | 4 ++-- .../java/org/mozilla/fenix/wallpapers/Wallpaper.kt | 10 +++++----- .../java/org/mozilla/fenix/nimbus/NimbusSystemTest.kt | 2 +- ktlint-baseline.xml | 4 ++-- 32 files changed, 34 insertions(+), 63 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/BookmarksTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/BookmarksTest.kt index 0bb18371b..58ab393f0 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/BookmarksTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/BookmarksTest.kt @@ -39,8 +39,6 @@ import org.mozilla.fenix.ui.robots.searchScreen * Tests for verifying basic functionality of bookmarks */ class BookmarksTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. - private lateinit var mockWebServer: MockWebServer private lateinit var mDevice: UiDevice private val bookmarksFolderName = "New Folder" diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/DownloadTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/DownloadTest.kt index 0b66ae82c..64de670f4 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/DownloadTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/DownloadTest.kt @@ -154,7 +154,7 @@ class DownloadTest { /* Verifies downloads in the Downloads Menu: - downloads appear in the list - deleting a download from device storage, removes it from the Downloads Menu too - */ + */ @SmokeTest @Test fun manageDownloadsInDownloadsMenuTest() { diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/HistoryTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/HistoryTest.kt index f061f01d7..223c7922f 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/HistoryTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/HistoryTest.kt @@ -38,7 +38,6 @@ import org.mozilla.fenix.ui.robots.searchScreen * */ class HistoryTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. private lateinit var mockWebServer: MockWebServer private lateinit var mDevice: UiDevice @@ -159,7 +158,6 @@ class HistoryTest { RecyclerViewIdlingResource(activityTestRule.activity.findViewById(R.id.history_list), 1), ) { clickDeleteAllHistoryButton() - } verifyDeleteConfirmationMessage() selectEverythingOption() diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt index ab0769dd3..96bf01118 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/HomeScreenTest.kt @@ -28,8 +28,6 @@ import org.mozilla.fenix.ui.robots.navigationToolbar */ class HomeScreenTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. - private lateinit var mDevice: UiDevice private lateinit var mockWebServer: MockWebServer private lateinit var firstPocketStoryPublisher: String diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/MediaNotificationTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/MediaNotificationTest.kt index 1a5495377..a0ded6e11 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/MediaNotificationTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/MediaNotificationTest.kt @@ -33,8 +33,6 @@ import org.mozilla.fenix.ui.robots.notificationShade * Note: this test only verifies media notifications, not media itself */ class MediaNotificationTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. - private lateinit var mockWebServer: MockWebServer private lateinit var mDevice: UiDevice diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/NavigationToolbarTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/NavigationToolbarTest.kt index bd4a77a1d..0dbc00328 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/NavigationToolbarTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/NavigationToolbarTest.kt @@ -37,7 +37,6 @@ class NavigationToolbarTest { private lateinit var mDevice: UiDevice private lateinit var mockWebServer: MockWebServer - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. @get:Rule val activityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides() diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAboutTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAboutTest.kt index 417d54bd3..8f3236701 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAboutTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAboutTest.kt @@ -25,8 +25,6 @@ import org.mozilla.fenix.ui.robots.homeScreen */ class SettingsAboutTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. - private lateinit var mDevice: UiDevice private lateinit var mockWebServer: MockWebServer diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt index affcee21a..597a41c9b 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsAdvancedTest.kt @@ -30,8 +30,6 @@ import org.mozilla.fenix.ui.robots.navigationToolbar */ class SettingsAdvancedTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. - private lateinit var mDevice: UiDevice private lateinit var mockWebServer: MockWebServer diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsDeleteBrowsingDataOnQuitTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsDeleteBrowsingDataOnQuitTest.kt index 517a3507f..38d5181b3 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsDeleteBrowsingDataOnQuitTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsDeleteBrowsingDataOnQuitTest.kt @@ -35,7 +35,6 @@ import org.mozilla.fenix.ui.robots.navigationToolbar * */ class SettingsDeleteBrowsingDataOnQuitTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. private lateinit var mockWebServer: MockWebServer @get:Rule diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsDeleteBrowsingDataTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsDeleteBrowsingDataTest.kt index e97336d36..92eb2693d 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsDeleteBrowsingDataTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsDeleteBrowsingDataTest.kt @@ -33,7 +33,6 @@ import org.mozilla.fenix.ui.robots.settingsScreen */ class SettingsDeleteBrowsingDataTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. private lateinit var mockWebServer: MockWebServer @get:Rule diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsDeveloperToolsTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsDeveloperToolsTest.kt index 94341b90c..e62ec5832 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsDeveloperToolsTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsDeveloperToolsTest.kt @@ -22,8 +22,6 @@ import org.mozilla.fenix.ui.robots.homeScreen */ class SettingsDeveloperToolsTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. - private lateinit var mDevice: UiDevice private lateinit var mockWebServer: MockWebServer diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsGeneralTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsGeneralTest.kt index a9e1a4ab5..36b5e32af 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsGeneralTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsGeneralTest.kt @@ -35,7 +35,6 @@ import java.util.Locale * */ class SettingsGeneralTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. private lateinit var mockWebServer: MockWebServer @get:Rule diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt index dd591ed73..e182fd593 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsPrivacyTest.kt @@ -24,8 +24,6 @@ import org.mozilla.fenix.ui.robots.notificationShade */ class SettingsPrivacyTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. - private lateinit var mDevice: UiDevice private lateinit var mockWebServer: MockWebServer diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsSyncTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsSyncTest.kt index bc479ea60..86777960c 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsSyncTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SettingsSyncTest.kt @@ -21,8 +21,6 @@ import org.mozilla.fenix.helpers.HomeActivityTestRule */ class SettingsSyncTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. - private lateinit var mDevice: UiDevice private lateinit var mockWebServer: MockWebServer diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt index b744408f9..83376ad65 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt @@ -93,7 +93,7 @@ class SmokeTest { - editing the url bar - the tab drawer button - opening a new search and dismissing the nav bar - */ + */ @Test fun verifyBasicNavigationToolbarFunctionality() { val defaultWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/TabbedBrowsingTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/TabbedBrowsingTest.kt index a4d097fce..2e486874f 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/TabbedBrowsingTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/TabbedBrowsingTest.kt @@ -42,7 +42,6 @@ class TabbedBrowsingTest { private lateinit var mDevice: UiDevice private lateinit var mockWebServer: MockWebServer - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. @get:Rule val activityTestRule = HomeActivityTestRule.withDefaultSettingsOverrides() diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/ThreeDotMenuMainTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/ThreeDotMenuMainTest.kt index b111ea4e2..afa02ef05 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/ThreeDotMenuMainTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/ThreeDotMenuMainTest.kt @@ -26,8 +26,6 @@ import org.mozilla.fenix.ui.robots.longClickPageObject */ class ThreeDotMenuMainTest { - /* ktlint-disable no-blank-line-before-rbrace */ // This imposes unreadable grouping. - private lateinit var mockWebServer: MockWebServer @get:Rule diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt index 9d477d97c..b7320450e 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt @@ -99,9 +99,9 @@ class BrowserRobot { } /* Asserts that the text within DOM element with ID="testContent" has the given text, i.e. - * document.querySelector('#testContent').innerText == expectedText - * - */ + * document.querySelector('#testContent').innerText == expectedText + * + */ fun verifyPageContent(expectedText: String) { sessionLoadedIdlingResource = SessionLoadedIdlingResource() diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt index 1e8790e5a..bccc3c225 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt @@ -217,15 +217,13 @@ class SettingsRobot { return BrowserRobot.Transition() } - fun openAboutFirefoxPreview(interact: SettingsSubMenuAboutRobot.() -> Unit): - SettingsSubMenuAboutRobot.Transition { + fun openAboutFirefoxPreview(interact: SettingsSubMenuAboutRobot.() -> Unit): SettingsSubMenuAboutRobot.Transition { aboutFirefoxHeading().click() SettingsSubMenuAboutRobot().interact() return SettingsSubMenuAboutRobot.Transition() } - fun openSearchSubMenu(interact: SettingsSubMenuSearchRobot.() -> Unit): - SettingsSubMenuSearchRobot.Transition { + fun openSearchSubMenu(interact: SettingsSubMenuSearchRobot.() -> Unit): SettingsSubMenuSearchRobot.Transition { itemWithText(getStringResource(R.string.preferences_search)) .also { it.waitForExists(waitingTimeShort) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/TabDrawerRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/TabDrawerRobot.kt index 8ba765109..0412ff9b5 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/TabDrawerRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/TabDrawerRobot.kt @@ -408,8 +408,7 @@ class TabDrawerRobot { return Transition() } - fun openRecentlyClosedTabs(interact: RecentlyClosedTabsRobot.() -> Unit): - RecentlyClosedTabsRobot.Transition { + fun openRecentlyClosedTabs(interact: RecentlyClosedTabsRobot.() -> Unit): RecentlyClosedTabsRobot.Transition { threeDotMenu().click() mDevice.waitNotNull( @@ -424,8 +423,7 @@ class TabDrawerRobot { return RecentlyClosedTabsRobot.Transition() } - fun clickSaveCollection(interact: CollectionRobot.() -> Unit): - CollectionRobot.Transition { + fun clickSaveCollection(interact: CollectionRobot.() -> Unit): CollectionRobot.Transition { saveTabsToCollectionButton().click() CollectionRobot().interact() diff --git a/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationView.kt b/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationView.kt index cd98d98de..fa907471f 100644 --- a/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationView.kt +++ b/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationView.kt @@ -72,7 +72,7 @@ class CollectionCreationView( interactor.onNewCollectionNameSaved(selectedTabs.toList(), text) SaveCollectionStep.RenameCollection -> selectedCollection?.let { interactor.onCollectionRenamed(it, text) } - else -> { /* noop */ + else -> { // noop } } } @@ -243,7 +243,7 @@ class CollectionCreationView( } transition.addListener( object : Transition.TransitionListener { - override fun onTransitionStart(transition: Transition) { /* noop */ + override fun onTransitionStart(transition: Transition) { // noop } override fun onTransitionEnd(transition: Transition) { @@ -251,13 +251,13 @@ class CollectionCreationView( transition.removeListener(this) } - override fun onTransitionCancel(transition: Transition) { /* noop */ + override fun onTransitionCancel(transition: Transition) { // noop } - override fun onTransitionPause(transition: Transition) { /* noop */ + override fun onTransitionPause(transition: Transition) { // noop } - override fun onTransitionResume(transition: Transition) { /* noop */ + override fun onTransitionResume(transition: Transition) { // noop } }, ) diff --git a/app/src/main/java/org/mozilla/fenix/components/FenixSnackbar.kt b/app/src/main/java/org/mozilla/fenix/components/FenixSnackbar.kt index b6914e1a3..8d6dd4a6a 100644 --- a/app/src/main/java/org/mozilla/fenix/components/FenixSnackbar.kt +++ b/app/src/main/java/org/mozilla/fenix/components/FenixSnackbar.kt @@ -76,7 +76,7 @@ class FenixSnackbar private constructor( companion object { const val LENGTH_LONG = Snackbar.LENGTH_LONG const val LENGTH_SHORT = Snackbar.LENGTH_SHORT - private const val LENGTH_ACCESSIBLE = 15000 /* 15 seconds in ms */ + private const val LENGTH_ACCESSIBLE = 15000 // 15 seconds in ms const val LENGTH_INDEFINITE = Snackbar.LENGTH_INDEFINITE private const val minTextSize = 12 diff --git a/app/src/main/java/org/mozilla/fenix/components/TrackingProtectionPolicyFactory.kt b/app/src/main/java/org/mozilla/fenix/components/TrackingProtectionPolicyFactory.kt index 4263d81b5..3ac7a7d8d 100644 --- a/app/src/main/java/org/mozilla/fenix/components/TrackingProtectionPolicyFactory.kt +++ b/app/src/main/java/org/mozilla/fenix/components/TrackingProtectionPolicyFactory.kt @@ -106,9 +106,9 @@ class TrackingProtectionPolicyFactory( } } +@Suppress("MaxLineLength") @VisibleForTesting -internal fun TrackingProtectionPolicyForSessionTypes.applyTCPIfNeeded(settings: Settings): - TrackingProtectionPolicyForSessionTypes { +internal fun TrackingProtectionPolicyForSessionTypes.applyTCPIfNeeded(settings: Settings): TrackingProtectionPolicyForSessionTypes { val updatedCookiePolicy = if (settings.enabledTotalCookieProtection) { CookiePolicy.ACCEPT_FIRST_PARTY_AND_ISOLATE_OTHERS } else { diff --git a/app/src/main/java/org/mozilla/fenix/components/history/PagedHistoryProvider.kt b/app/src/main/java/org/mozilla/fenix/components/history/PagedHistoryProvider.kt index 00cf6002b..69ad92448 100644 --- a/app/src/main/java/org/mozilla/fenix/components/history/PagedHistoryProvider.kt +++ b/app/src/main/java/org/mozilla/fenix/components/history/PagedHistoryProvider.kt @@ -15,7 +15,7 @@ import org.mozilla.fenix.library.history.History import org.mozilla.fenix.library.history.HistoryItemTimeGroup import org.mozilla.fenix.utils.Settings.Companion.SEARCH_GROUP_MINIMUM_SITES -private const val BUFFER_TIME = 15000 /* 15 seconds in ms */ +private const val BUFFER_TIME = 15000 // 15 seconds in ms /** * Class representing a history entry. diff --git a/app/src/main/java/org/mozilla/fenix/compose/ClickableSubstringLink.kt b/app/src/main/java/org/mozilla/fenix/compose/ClickableSubstringLink.kt index 410dd9cdc..9a0429702 100644 --- a/app/src/main/java/org/mozilla/fenix/compose/ClickableSubstringLink.kt +++ b/app/src/main/java/org/mozilla/fenix/compose/ClickableSubstringLink.kt @@ -83,8 +83,8 @@ fun ClickableSubstringLink( annotatedText .getStringAnnotations("link", it, it) .firstOrNull()?.let { - onClick() - } + onClick() + } }, ) } diff --git a/app/src/main/java/org/mozilla/fenix/perf/AppStartReasonProvider.kt b/app/src/main/java/org/mozilla/fenix/perf/AppStartReasonProvider.kt index 1b54f1589..b49ec71fd 100644 --- a/app/src/main/java/org/mozilla/fenix/perf/AppStartReasonProvider.kt +++ b/app/src/main/java/org/mozilla/fenix/perf/AppStartReasonProvider.kt @@ -69,7 +69,7 @@ class AppStartReasonProvider { // this Runnable should execute before the first Activity is created. reason = when (reason) { StartReason.TO_BE_DETERMINED -> StartReason.NON_ACTIVITY - StartReason.ACTIVITY -> reason /* the start reason is already known: do nothing. */ + StartReason.ACTIVITY -> reason // the start reason is already known: do nothing. StartReason.NON_ACTIVITY -> { Metrics.startReasonProcessError.set(true) logger.error("AppStartReasonProvider.Process...onCreate unexpectedly called twice") @@ -87,7 +87,7 @@ class AppStartReasonProvider { // See ProcessLifecycleObserver.onCreate for details. reason = when (reason) { StartReason.TO_BE_DETERMINED -> StartReason.ACTIVITY - StartReason.NON_ACTIVITY -> reason /* the start reason is already known: do nothing. */ + StartReason.NON_ACTIVITY -> reason // the start reason is already known: do nothing. StartReason.ACTIVITY -> { Metrics.startReasonActivityError.set(true) logger.error("AppStartReasonProvider.Activity...onCreate unexpectedly called twice") diff --git a/app/src/main/java/org/mozilla/fenix/settings/about/AboutLibrariesFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/about/AboutLibrariesFragment.kt index b83c8248c..98a3a11b9 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/about/AboutLibrariesFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/about/AboutLibrariesFragment.kt @@ -77,7 +77,7 @@ class AboutLibrariesFragment : Fragment(R.layout.fragment_about_libraries) { [name] : either the name of the library, or its artifact name. See https://github.com/google/play-services-plugins/tree/master/oss-licenses-plugin - */ + */ val licensesData = resources .openRawResource(R.raw.third_party_licenses) .readBytes() diff --git a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/dialog/CookieBannerReEngagementDialog.kt b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/dialog/CookieBannerReEngagementDialog.kt index fd156f963..16378f081 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/dialog/CookieBannerReEngagementDialog.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/dialog/CookieBannerReEngagementDialog.kt @@ -107,6 +107,6 @@ class CookieBannerReEngagementDialog : DialogFragment() { } companion object { - private const val LENGTH_SNACKBAR_DURATION = 4000 /* 4 seconds in ms */ + private const val LENGTH_SNACKBAR_DURATION = 4000 // 4 seconds in ms } } diff --git a/app/src/main/java/org/mozilla/fenix/share/SaveToPDFMiddleware.kt b/app/src/main/java/org/mozilla/fenix/share/SaveToPDFMiddleware.kt index 31c43daa0..6d757c9d9 100644 --- a/app/src/main/java/org/mozilla/fenix/share/SaveToPDFMiddleware.kt +++ b/app/src/main/java/org/mozilla/fenix/share/SaveToPDFMiddleware.kt @@ -78,7 +78,7 @@ class SaveToPDFMiddleware( * @param exception - A given exception that will be properly labeled for telemetry posting. * @return processed failure reason to send in telemetry. */ - /* package */ @VisibleForTesting + @VisibleForTesting // package fun telemetryErrorReason(exception: Exception): String { var failureMsg = "unknown" // Requiring information from GeckoView isn't a good practice, @@ -105,7 +105,7 @@ class SaveToPDFMiddleware( * @param isPdfViewer - If the page has a PDF viewer or not. * @return processed page source type to send in telemetry. */ - /* package */ @VisibleForTesting + @VisibleForTesting // package fun telemetrySource(isPdfViewer: Boolean?): String { val source = when (isPdfViewer) { null -> "unknown" diff --git a/app/src/main/java/org/mozilla/fenix/wallpapers/Wallpaper.kt b/app/src/main/java/org/mozilla/fenix/wallpapers/Wallpaper.kt index efcbed05c..40684801a 100644 --- a/app/src/main/java/org/mozilla/fenix/wallpapers/Wallpaper.kt +++ b/app/src/main/java/org/mozilla/fenix/wallpapers/Wallpaper.kt @@ -60,11 +60,11 @@ data class Wallpaper( const val defaultName = "default" /* - Note: this collection could get out of sync with the version of it generated when fetching - remote metadata. It is included mostly for convenience, but use with utmost care until - we find a better way of handling the edge cases around this collection. It is generally - safer to do comparison directly with the collection name. - */ + * Note: this collection could get out of sync with the version of it generated when fetching + * remote metadata. It is included mostly for convenience, but use with utmost care until + * we find a better way of handling the edge cases around this collection. It is generally + * safer to do comparison directly with the collection name. + */ const val classicFirefoxCollectionName = "classic-firefox" val ClassicFirefoxCollection = Collection( name = classicFirefoxCollectionName, diff --git a/app/src/test/java/org/mozilla/fenix/nimbus/NimbusSystemTest.kt b/app/src/test/java/org/mozilla/fenix/nimbus/NimbusSystemTest.kt index b3e2362b4..fd4ac97f1 100644 --- a/app/src/test/java/org/mozilla/fenix/nimbus/NimbusSystemTest.kt +++ b/app/src/test/java/org/mozilla/fenix/nimbus/NimbusSystemTest.kt @@ -31,7 +31,7 @@ class NimbusSystemTest { // By default this comes from the generated Nimbus features. val config = NimbusSystem( - refreshIntervalForeground = 60, /* minutes */ + refreshIntervalForeground = 60, // minutes ) class NimbusUnderTest(override val context: Context) : NimbusInterface { diff --git a/ktlint-baseline.xml b/ktlint-baseline.xml index fdc6f6750..b033ff3cc 100644 --- a/ktlint-baseline.xml +++ b/ktlint-baseline.xml @@ -4,7 +4,7 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - - + +