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

MissingPackageDeclaration - Incorrect issue reported. #7296

Open
Abhimanyu14 opened this issue May 15, 2024 · 0 comments
Open

MissingPackageDeclaration - Incorrect issue reported. #7296

Abhimanyu14 opened this issue May 15, 2024 · 0 comments
Labels

Comments

@Abhimanyu14
Copy link

Abhimanyu14 commented May 15, 2024

MissingPackageDeclaration rule is reporting an issue for a file that does have package declaration.

Expected Behavior

No issues

Observed Behavior

MissingPackageDeclaration rule is reporting an issue for a file that does have package declaration.

Steps to Reproduce

Running detekt checks.

Context

Your Environment

  • Version of detekt used:
  • Version of Gradle used (if applicable):
  • Gradle scan link (add --scan option when running the gradle task):
  • Operating System and version:
  • Link to your project (if it's a public repository): https://github.com/Abhimanyu14/finance-manager

Note:
Issue reported only for a particular file.

/Users/abhimanyu/Documents/projects/finance-manager/codebase/android/core/common/src/main/java/com/makeappssimple/abhimanyu/financemanager/android/core/common/extensions/StringExtension.kt:1:1: The file does not contain a package declaration. [MissingPackageDeclaration]

package com.makeappssimple.abhimanyu.financemanager.android.core.common.extensions

import kotlin.contracts.contract

public fun String?.isNotNullOrBlank(): Boolean {
    contract {
        returns(true) implies (this@isNotNullOrBlank != null)
    }
    return !this.isNullOrBlank()
}

// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant