* #3880. Update detekt to 1.9.1

* #3880. Use `AbsentOrWrongFileLicense` detekt rule

* #3880. Update detekt baseline

Co-authored-by: Denys M <dector9@gmail.com>
This commit is contained in:
liuche 2020-07-20 15:09:58 -07:00 committed by GitHub
parent cd2532349d
commit 09d0688e64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 60 additions and 9 deletions

View File

@ -72,7 +72,7 @@ buildscript {
}
plugins {
id("io.gitlab.arturbosch.detekt").version("1.6.0")
id("io.gitlab.arturbosch.detekt").version("1.9.1")
}
allprojects {
@ -133,8 +133,7 @@ allprojects {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.allWarningsAsErrors = true
kotlinOptions.freeCompilerArgs += [
"-Xuse-experimental=kotlin.Experimental",
"-Xskip-runtime-version-check"
"-Xuse-experimental=kotlin.Experimental"
]
}
}
@ -145,9 +144,10 @@ task clean(type: Delete) {
detekt {
// The version number is duplicated, please refer to plugins block for more details
version = "1.6.0"
version = "1.9.1"
input = files("$projectDir/app/src")
config = files("$projectDir/config/detekt.yml")
baseline = file("$projectDir/config/detekt-baseline.xml")
reports {
html {

View File

@ -11,7 +11,7 @@ object Versions {
const val leanplum = "5.4.0"
const val osslicenses_plugin = "0.9.5"
const val osslicenses_library = "17.0.0"
const val detekt = "1.6.0"
const val detekt = "1.9.1"
const val androidx_appcompat = "1.2.0-rc01"
const val androidx_biometric = "1.1.0-alpha01"

View File

@ -0,0 +1,50 @@
<?xml version="1.0" ?>
<SmellBaseline>
<Blacklist></Blacklist>
<Whitelist>
<ID>AbsentOrWrongFileLicense:AboutItemViewHolder.kt$org.mozilla.fenix.settings.about.viewholders.AboutItemViewHolder.kt</ID>
<ID>AbsentOrWrongFileLicense:AccountSettingsFragmentStore.kt$org.mozilla.fenix.settings.account.AccountSettingsFragmentStore.kt</ID>
<ID>AbsentOrWrongFileLicense:AccountSettingsInteractor.kt$org.mozilla.fenix.settings.account.AccountSettingsInteractor.kt</ID>
<ID>AbsentOrWrongFileLicense:ButtonTipViewHolder.kt$org.mozilla.fenix.home.tips.ButtonTipViewHolder.kt</ID>
<ID>AbsentOrWrongFileLicense:CustomTabContextMenuCandidate.kt$org.mozilla.fenix.browser.CustomTabContextMenuCandidate.kt</ID>
<ID>AbsentOrWrongFileLicense:ExceptionsFragmentStore.kt$org.mozilla.fenix.loginexceptions.ExceptionsFragmentStore.kt</ID>
<ID>AbsentOrWrongFileLicense:ExceptionsFragmentStore.kt$org.mozilla.fenix.trackingprotectionexceptions.ExceptionsFragmentStore.kt</ID>
<ID>AbsentOrWrongFileLicense:ExceptionsInteractor.kt$org.mozilla.fenix.trackingprotectionexceptions.ExceptionsInteractor.kt</ID>
<ID>AbsentOrWrongFileLicense:FeatureFlags.kt$org.mozilla.fenix.FeatureFlags.kt</ID>
<ID>AbsentOrWrongFileLicense:HistoryController.kt$org.mozilla.fenix.library.history.HistoryController.kt</ID>
<ID>AbsentOrWrongFileLicense:HistoryFragmentStore.kt$org.mozilla.fenix.library.history.HistoryFragmentStore.kt</ID>
<ID>AbsentOrWrongFileLicense:HistoryInteractor.kt$org.mozilla.fenix.library.history.HistoryInteractor.kt</ID>
<ID>AbsentOrWrongFileLicense:InflationAwareFeature.kt$org.mozilla.fenix.components.InflationAwareFeature.kt</ID>
<ID>AbsentOrWrongFileLicense:LoginExceptionsInteractor.kt$org.mozilla.fenix.loginexceptions.LoginExceptionsInteractor.kt</ID>
<ID>AbsentOrWrongFileLicense:MigrationTelemetryListener.kt$org.mozilla.fenix.migration.MigrationTelemetryListener.kt</ID>
<ID>AbsentOrWrongFileLicense:Push.kt$org.mozilla.fenix.components.Push.kt</ID>
<ID>AbsentOrWrongFileLicense:SearchController.kt$org.mozilla.fenix.search.SearchController.kt</ID>
<ID>AbsentOrWrongFileLicense:SearchFragmentStore.kt$org.mozilla.fenix.search.SearchFragmentStore.kt</ID>
<ID>AbsentOrWrongFileLicense:SharedPreferenceUpdater.kt$org.mozilla.fenix.settings.SharedPreferenceUpdater.kt</ID>
<ID>AbsentOrWrongFileLicense:StoreProvider.kt$org.mozilla.fenix.components.StoreProvider.kt</ID>
<ID>AbsentOrWrongFileLicense:TabCounterMenuItem.kt$org.mozilla.fenix.components.toolbar.TabCounterMenuItem.kt</ID>
<ID>AbsentOrWrongFileLicense:ToolbarView.kt$org.mozilla.fenix.search.toolbar.ToolbarView.kt</ID>
<ID>AbsentOrWrongFileLicense:TrackingProtectionStore.kt$org.mozilla.fenix.trackingprotection.TrackingProtectionStore.kt</ID>
<ID>AbsentOrWrongFileLicense:ViewHolder.kt$org.mozilla.fenix.utils.view.ViewHolder.kt</ID>
<ID>AbsentOrWrongFileLicense:WhatsNew.kt$org.mozilla.fenix.whatsnew.WhatsNew.kt</ID>
<ID>AbsentOrWrongFileLicense:WhatsNewStorage.kt$org.mozilla.fenix.whatsnew.WhatsNewStorage.kt</ID>
<ID>AbsentOrWrongFileLicense:WhatsNewVersion.kt$org.mozilla.fenix.whatsnew.WhatsNewVersion.kt</ID>
<ID>LongParameterList:BackgroundServices.kt$BackgroundServices$( private val context: Context, private val push: Push, crashReporter: CrashReporter, historyStorage: Lazy&lt;PlacesHistoryStorage&gt;, bookmarkStorage: Lazy&lt;PlacesBookmarksStorage&gt;, passwordsStorage: Lazy&lt;SyncableLoginsStorage&gt;, remoteTabsStorage: Lazy&lt;RemoteTabsStorage&gt; )</ID>
<ID>LongParameterList:BookmarkController.kt$DefaultBookmarkController$( private val activity: HomeActivity, private val navController: NavController, private val clipboardManager: ClipboardManager?, private val scope: CoroutineScope, private val store: BookmarkFragmentStore, private val sharedViewModel: BookmarksSharedViewModel, private val loadBookmarkNode: suspend (String) -&gt; BookmarkNode?, private val showSnackbar: (String) -&gt; Unit, private val deleteBookmarkNodes: (Set&lt;BookmarkNode&gt;, Event) -&gt; Unit, private val deleteBookmarkFolder: (BookmarkNode) -&gt; Unit, private val invokePendingDeletion: () -&gt; Unit )</ID>
<ID>LongParameterList:BrowserToolbarController.kt$DefaultBrowserToolbarController$( private val activity: HomeActivity, private val navController: NavController, private val readerModeController: ReaderModeController, private val sessionFeature: ViewBoundFeatureWrapper&lt;SessionFeature&gt;, private val sessionManager: SessionManager, private val findInPageLauncher: () -&gt; Unit, private val engineView: EngineView, private val browserAnimator: BrowserAnimator, private val swipeRefresh: SwipeRefreshLayout, private val customTabSession: Session?, private val openInFenixIntent: Intent, private val bookmarkTapped: (Session) -&gt; Unit, private val scope: CoroutineScope, private val tabCollectionStorage: TabCollectionStorage, private val topSiteStorage: TopSiteStorage, private val onTabCounterClicked: () -&gt; Unit, private val onCloseTab: (Session) -&gt; Unit )</ID>
<ID>LongParameterList:CollectionCreationController.kt$DefaultCollectionCreationController$( private val store: CollectionCreationStore, private val dismiss: () -&gt; Unit, private val metrics: MetricController, private val tabCollectionStorage: TabCollectionStorage, private val sessionManager: SessionManager, private val ioScope: CoroutineScope )</ID>
<ID>LongParameterList:CollectionCreationTabListAdapter.kt$TabDiffUtil$( val old: List&lt;Tab&gt;, val new: List&lt;Tab&gt;, val oldSelected: Set&lt;Tab&gt;, val newSelected: Set&lt;Tab&gt;, val oldHideCheckboxes: Boolean, val newHideCheckboxes: Boolean )</ID>
<ID>LongParameterList:CustomTabsIntegration.kt$CustomTabsIntegration$( sessionManager: SessionManager, toolbar: BrowserToolbar, sessionId: String, activity: Activity, onItemTapped: (ToolbarMenu.Item) -&gt; Unit = {}, shouldReverseItems: Boolean, isPrivate: Boolean )</ID>
<ID>LongParameterList:DefaultToolbarMenu.kt$DefaultToolbarMenu$( private val context: Context, private val sessionManager: SessionManager, private val store: BrowserStore, hasAccountProblem: Boolean = false, shouldReverseItems: Boolean, private val onItemTapped: (ToolbarMenu.Item) -&gt; Unit = {}, private val lifecycleOwner: LifecycleOwner, private val bookmarksStorage: BookmarksStorage )</ID>
<ID>LongParameterList:DynamicDownloadDialog.kt$DynamicDownloadDialog$( private val container: ViewGroup, private val downloadState: DownloadState?, private val didFail: Boolean, private val tryAgain: (Long) -&gt; Unit, private val onCannotOpenFile: () -&gt; Unit, private val view: View, private val toolbarHeight: Int, private val onDismiss: () -&gt; Unit )</ID>
<ID>LongParameterList:HistoryController.kt$DefaultHistoryController$( private val store: HistoryFragmentStore, private val navController: NavController, private val resources: Resources, private val snackbar: FenixSnackbar, private val clipboardManager: ClipboardManager, private val scope: CoroutineScope, private val openToBrowser: (item: HistoryItem, mode: BrowsingMode?) -&gt; Unit, private val displayDeleteAll: () -&gt; Unit, private val invalidateOptionsMenu: () -&gt; Unit, private val deleteHistoryItems: (Set&lt;HistoryItem&gt;) -&gt; Unit, private val syncHistory: suspend () -&gt; Unit )</ID>
<ID>LongParameterList:IntentProcessors.kt$IntentProcessors$( private val context: Context, private val sessionManager: SessionManager, private val sessionUseCases: SessionUseCases, private val searchUseCases: SearchUseCases, private val relationChecker: RelationChecker, private val customTabsStore: CustomTabsServiceStore, private val migrationStore: MigrationStore, private val manifestStorage: ManifestStorage )</ID>
<ID>LongParameterList:QuickSettingsController.kt$DefaultQuickSettingsController$( private val context: Context, private val quickSettingsStore: QuickSettingsFragmentStore, private val ioScope: CoroutineScope, private val navController: NavController, private val session: Session?, private var sitePermissions: SitePermissions?, private val settings: Settings, private val permissionStorage: PermissionStorage, private val reload: ReloadUrlUseCase, private val addNewTab: AddNewTabUseCase, private val requestRuntimePermissions: OnNeedToRequestPermissions = { }, private val displayPermissions: () -&gt; Unit, private val dismiss: () -&gt; Unit )</ID>
<ID>LongParameterList:SessionControlController.kt$DefaultSessionControlController$( private val activity: HomeActivity, private val fragmentStore: HomeFragmentStore, private val navController: NavController, private val viewLifecycleScope: CoroutineScope, private val getListOfTabs: () -&gt; List&lt;Tab&gt;, private val hideOnboarding: () -&gt; Unit, private val registerCollectionStorageObserver: () -&gt; Unit, private val showDeleteCollectionPrompt: (tabCollection: TabCollection, title: String?, message: String) -&gt; Unit, private val openSettingsScreen: () -&gt; Unit, private val openWhatsNewLink: () -&gt; Unit, private val openPrivacyNotice: () -&gt; Unit, private val showTabTray: () -&gt; Unit )</ID>
<ID>LongParameterList:ShareController.kt$DefaultShareController$( private val context: Context, private val shareData: List&lt;ShareData&gt;, private val sendTabUseCases: SendTabUseCases, private val snackbar: FenixSnackbar, private val navController: NavController, private val recentAppsStorage: RecentAppsStorage, private val viewLifecycleScope: CoroutineScope, private val dismiss: (ShareController.Result) -&gt; Unit )</ID>
<ID>LongParameterList:ToolbarIntegration.kt$DefaultToolbarIntegration$( context: Context, toolbar: BrowserToolbar, toolbarMenu: ToolbarMenu, domainAutocompleteProvider: DomainAutocompleteProvider, historyStorage: HistoryStorage, sessionManager: SessionManager, sessionId: String? = null, isPrivate: Boolean, interactor: BrowserToolbarViewInteractor, engine: Engine )</ID>
<ID>LongParameterList:ToolbarIntegration.kt$ToolbarIntegration$( context: Context, toolbar: BrowserToolbar, toolbarMenu: ToolbarMenu, sessionId: String?, isPrivate: Boolean, renderStyle: ToolbarFeature.RenderStyle )</ID>
<ID>LongParameterList:ToolbarView.kt$ToolbarView$( private val context: Context, private val interactor: ToolbarInteractor, private val historyStorage: HistoryStorage?, private val isPrivate: Boolean, val view: BrowserToolbar, engine: Engine )</ID>
<ID>LongParameterList:UseCases.kt$UseCases$( private val context: Context, private val engine: Engine, private val sessionManager: SessionManager, private val store: BrowserStore, private val searchEngineManager: SearchEngineManager, private val shortcutManager: WebAppShortcutManager )</ID>
</Whitelist>
</SmellBaseline>

View File

@ -23,10 +23,6 @@ console-reports:
# - 'NotificationReport'
# - 'FindingsReport'
# - 'BuildFailureReport'
console-reports:
active: true
exclude:
# - 'HtmlOutputReport'
- 'PlainOutputReport'
- 'XmlOutputReport'
@ -34,6 +30,8 @@ console-reports:
comments:
active: true
excludes: "**/*Test.kt, **/*Spec.kt, **/test/**, **/androidTest/**"
AbsentOrWrongFileLicense:
active: true
CommentOverPrivateFunction:
active: false
CommentOverPrivateProperty:

3
config/license.template Normal file
View File

@ -0,0 +1,3 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */