Skip to content

Commit

Permalink
style(detekt): Enable the "MissingPackageDeclaration" rule
Browse files Browse the repository at this point in the history
Enable the "MissingPackageDeclaration" rule [1] to ensure that all Kotlin
source files have a package declaration.

[1]: https://detekt.dev/docs/rules/potential-bugs#missingpackagedeclaration

Signed-off-by: Nicolas Nobelis <[email protected]>
  • Loading branch information
nnobelis authored and sschuberth committed Oct 2, 2023
1 parent 0057704 commit 3207d1e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ style:
- kotlinx.html.*
- kotlinx.html.dom.*

potential-bugs:
MissingPackageDeclaration:
active: true
excludes: ["**/GradleModel.kt", "**/build.gradle.kts"]

ORT:
OrtImportOrder:
active: true
Expand Down
2 changes: 2 additions & 0 deletions advisor/src/funTest/kotlin/OsvFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* License-Filename: LICENSE
*/

package org.ossreviewtoolkit.advisor

import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.collections.shouldContainExactlyInAnyOrder
import io.kotest.matchers.shouldBe
Expand Down
7 changes: 2 additions & 5 deletions clients/osv/src/funTest/kotlin/OsvServiceFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* License-Filename: LICENSE
*/

package org.ossreviewtoolkit.clients.osv

import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.collections.shouldContainExactlyInAnyOrder
import io.kotest.matchers.result.shouldBeSuccess
Expand All @@ -26,11 +28,6 @@ import java.time.Instant

import kotlinx.serialization.json.JsonObject

import org.ossreviewtoolkit.clients.osv.OsvApiClient
import org.ossreviewtoolkit.clients.osv.OsvService
import org.ossreviewtoolkit.clients.osv.Package
import org.ossreviewtoolkit.clients.osv.VulnerabilitiesForPackageRequest
import org.ossreviewtoolkit.clients.osv.Vulnerability
import org.ossreviewtoolkit.utils.test.getAssetAsString

private val VULNERABILITY_FOR_PACKAGE_BY_COMMIT_REQUEST = VulnerabilitiesForPackageRequest(
Expand Down
3 changes: 2 additions & 1 deletion clients/scanoss/src/test/kotlin/ScanOssDetailsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* License-Filename: LICENSE
*/

package org.ossreviewtoolkit.clients.scanoss

import com.github.tomakehurst.wiremock.WireMockServer
import com.github.tomakehurst.wiremock.core.WireMockConfiguration

Expand All @@ -34,7 +36,6 @@ import okhttp3.MediaType.Companion.toMediaType
import okhttp3.MultipartBody
import okhttp3.RequestBody.Companion.asRequestBody

import org.ossreviewtoolkit.clients.scanoss.ScanOssService
import org.ossreviewtoolkit.clients.scanoss.model.Source
import org.ossreviewtoolkit.utils.test.shouldNotBeNull

Expand Down
3 changes: 2 additions & 1 deletion clients/scanoss/src/test/kotlin/ScanOssServiceTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* License-Filename: LICENSE
*/

package org.ossreviewtoolkit.clients.scanoss

import com.github.tomakehurst.wiremock.WireMockServer
import com.github.tomakehurst.wiremock.core.WireMockConfiguration

Expand All @@ -33,7 +35,6 @@ import okhttp3.MediaType.Companion.toMediaType
import okhttp3.MultipartBody
import okhttp3.RequestBody.Companion.asRequestBody

import org.ossreviewtoolkit.clients.scanoss.ScanOssService
import org.ossreviewtoolkit.clients.scanoss.model.IdentificationType
import org.ossreviewtoolkit.utils.test.shouldNotBeNull

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* License-Filename: LICENSE
*/

package org.ossreviewtoolkit.plugins.packageconfigurationproviders.ortconfig

import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.collections.beEmpty
import io.kotest.matchers.collections.haveSize
Expand All @@ -26,7 +28,6 @@ import org.ossreviewtoolkit.model.ArtifactProvenance
import org.ossreviewtoolkit.model.Hash
import org.ossreviewtoolkit.model.Identifier
import org.ossreviewtoolkit.model.RemoteArtifact
import org.ossreviewtoolkit.plugins.packageconfigurationproviders.ortconfig.OrtConfigPackageConfigurationProvider

class OrtConfigPackageConfigurationProviderFunTest : StringSpec({

Check warning on line 32 in plugins/package-configuration-providers/ort-config/src/test/kotlin/OrtConfigPackageConfigurationProviderFunTest.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused symbol

Class "OrtConfigPackageConfigurationProviderFunTest" is never used
"provider can load package-configurations from the ort-config repository" {
Expand Down

0 comments on commit 3207d1e

Please sign in to comment.