Skip to content

Exclude new Kotlin Test directories in default config #5727

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

Closed
remcomokveld opened this issue Jan 26, 2023 · 2 comments · Fixed by #5797
Closed

Exclude new Kotlin Test directories in default config #5727

remcomokveld opened this issue Jan 26, 2023 · 2 comments · Fixed by #5797

Comments

@remcomokveld
Copy link
Contributor

Expected Behavior

A project using kotlin's new source directory structure does not enforce rules like lateinitusage for files in src/androidUnitTest/** and src/androidInstrumentedTest/** when using the default configuration.

Current Behavior

rules that are excluded by tests in the default config should also be excluded in the new test folder structure.

Context

Kotlin 1.8 introduces a new folder structure https://kotlinlang.org/docs/whatsnew18.html#sourcedirectories

The default detekt configuration file excludes a bunch of different variants of test source sets by default.

It would be nice to either add the new androidUnitTest and androidInstrumentedTest to those defaults as well, or maybe even better, build in support for defaulting all test source sets to be excluded (not sure how feasible that is).

@cortinico
Copy link
Member

It would be nice to either add the new androidUnitTest and androidInstrumentedTest to those defaults as well, or maybe even better, build in support for defaulting all test source sets to be excluded (not sure how feasible that is).

I believe the best would be to add **/androidUnitTest/** and **/androidInstrumentedTest/** to our default excludes as suggested 👍

@chao2zhang chao2zhang added this to the 1.23.0 milestone Feb 21, 2023
@chao2zhang
Copy link
Member

Adding this issue the next release milestone as the main branch is already on Kotlin 1.8

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

Successfully merging a pull request may close this issue.

4 participants