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

How to test new rules in real world projects easily #4408

Open
BraisGabin opened this issue Dec 27, 2021 · 8 comments
Open

How to test new rules in real world projects easily #4408

BraisGabin opened this issue Dec 27, 2021 · 8 comments
Labels
feature never gets stale Mark Issues/PRs that should not be closed as they won't get stale

Comments

@BraisGabin
Copy link
Member

Expected Behavior

It should be easy to test a new rule agains some Open Source sample projects to spot issues in the rule implementation.

Current Behavior

This is really difficult we have this script: https://github.com/detekt/detekt/blob/main/scripts/get_analysis_projects.kts but it is just usefull if you don't use Type Solving.

Context

#4033 and #4394 (review)

Possible solution

We should list projects that already use detekt and use those for this tests using the --including-build feature from gradle.

@schalkms
Copy link
Member

Another way would be to fork the projects linked in the mentioned script and configure detekt in the Gradle scripts of those forks.

@BraisGabin
Copy link
Member Author

That sounds good too. We could even ask to the maintainer if they are interested in detekt and merge it.

@chao2zhang
Copy link
Member

I used https://github.com/cortinico/kotlin-android-template to test new rules or changes to the existing rule.

@cortinico
Copy link
Member

I used cortinico/kotlin-android-template to test new rules or changes to the existing rule.

That's a good playground. The problem is that it contains not much code so a codebase like https://github.com/mozilla-mobile/fenix would provide some real-world scenario.

@BraisGabin
Copy link
Member Author

That's a good one! And they have detekt already in the project. It's not the last version but we can contribute to update it.

@BraisGabin
Copy link
Member Author

I just open an issue in the Fenix repo to know if they are interested on detekt with type solving. Depending on they answer we can decide the next steps here. mozilla-mobile/fenix#23124

@github-actions
Copy link

github-actions bot commented Apr 9, 2022

This issue is stale because it has been open 90 days with no activity. Please comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Apr 9, 2022
@cortinico cortinico added never gets stale Mark Issues/PRs that should not be closed as they won't get stale and removed stale labels Apr 9, 2022
@TWiStErRob
Copy link
Member

Related TWiStErRob/repros@d3019d7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature never gets stale Mark Issues/PRs that should not be closed as they won't get stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants