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

androidGeneratedClasses() filters out non-generated classes. #713

Open
johngray1965 opened this issue Dec 15, 2024 · 1 comment
Open

androidGeneratedClasses() filters out non-generated classes. #713

johngray1965 opened this issue Dec 15, 2024 · 1 comment
Assignees
Labels
Question Support request issue type S: in progress Status: implementing or design in process

Comments

@johngray1965
Copy link

Describe the bug
The predefined report filter, androirdGeneratedClasses() is defined as:
public fun androidGeneratedClasses() {
classes(
"Fragment",
"Fragment$",
"Activity",
"Activity$",
"
.databinding.
",
"*.BuildConfig"
)
}

among other things it filters out classes that end with Fragment or Activity. It's common to name activities and fragment with that pattern.

Errors
Production code is filtered out. For instance InstaPaperLoginFragment was filtered, as was BookmarksFragment.

Expected behavior
I'm not 100% clear on what generated code "*Fragment", and "*Activity" was intended to catch, but it certainly needs to more specific so it doesn't remove MainActivity and the like. And BTW, there lots of generated code its not filtering. Right now, it's just counterproductive.

Reproducer
Create any classes that end in Activty or Fragment, and use androidGeneratedClasses().
Reports
If applicable, report files or screenshots.

Environment

  • Kover Gradle Plugin version: 0.9.0
  • Gradle version: 8.7.3
  • Kotlin project type: Kotlin/Android
  • Coverage Toolset: Kover
  • Other context important for this bug: [e.g. OS version]
@johngray1965 johngray1965 added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Dec 15, 2024
@shanshin shanshin added Question Support request issue type S: in progress Status: implementing or design in process and removed Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Dec 17, 2024
@shanshin
Copy link
Collaborator

Hi,
the use of androidGeneratedClasses() is not necessary, if this set of filters does not suit your project, you can define your own suitable filters.

The documentation for the function indicates which classes it excludes from the report. It covers case for most of the user, but it cannot be applied to absolutely everyone, so for your project it is necessary to specify filters that are suitable only for you.

If this function will causes misunderstanding among other users, then it would be better to remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Support request issue type S: in progress Status: implementing or design in process
Projects
None yet
Development

No branches or pull requests

2 participants