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

Exclude classes by path #676

Open
friscoMad opened this issue Aug 20, 2024 · 1 comment
Open

Exclude classes by path #676

friscoMad opened this issue Aug 20, 2024 · 1 comment
Labels
Feature Feature request issue type S: postponed Status: work on the issue is not in the short term plans

Comments

@friscoMad
Copy link

What is your use-case and why do you need this feature?

We would like to exclude all generated sources from the coverage report/verify rules, we are using dagger that adds some annotations but they don't have BINARY or RUNTIME retention.
Source set exclusion does not work for us as Kapt generated sources are included in the main source set.
We could use class inheritance to filter some (maybe all) generated classes but it is not working and even when working it adds a time penalty.
Adding a feature to exclude from reports/verification based on source path can help excluding all autogenerated classes that are stored in the build directory in gradle it should be efficient and work with most of the code generation tools as they tend to store the generated classes in a different path.

Describe the solution you'd like
Add another option to exclude (maybe include) classes by file path, perhaps an exclude dir option or something similar.

@friscoMad friscoMad added Feature Feature request issue type S: untriaged Status: issue reported but unprocessed labels Aug 20, 2024
@shanshin
Copy link
Collaborator

Unfortunately, there is a problem with the directory filter, namely, compiled class-files do not store the directory where the source file was located, but only the name of this file.

We can indirectly guess the directory by the package name and the filename from the class-file.
However, in general, this does not work, because in Kotlin, the directory name may differ from the package name.
Such collisions are poorly detected, so such a filter will be unreliable.

To ensure that the source file directory is analyzed, it is necessary to work at the compiler level.
We will be able to implement this after integration with KGP (see #608), because this is a major change that also changes the workflow of Kover.

@shanshin shanshin added S: postponed Status: work on the issue is not in the short term plans and removed S: untriaged Status: issue reported but unprocessed labels Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature request issue type S: postponed Status: work on the issue is not in the short term plans
Projects
None yet
Development

No branches or pull requests

2 participants