-
-
Notifications
You must be signed in to change notification settings - Fork 755
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
Allow different naming conventions for tests #24
Comments
You can achieve this by having two different Gradle tasks with different Here is example of configuration for all files except tests
Configuration for files in "test" directories
As I said, difference in Disadvantage of this approach is that you have to duplicate your configuration, because mostly it will be identical (except naming configuration) |
Awesome, that will work well. Maybe a different suggestion would be to allow multiple config files (like how Proguard works), so the common stuff could be in one place, and my tests could override an option? |
It makes perfectly sense to have different conditions for production code and test code etc. For example we could allow higher thresholds for e.g. LongMethod in test cases and naming conventions like @scottkennedy suggested. I just have not figure out the best way to support this. I don't want to have some extra logic to filter for test paths and main paths in the core module. Also something like 'profiles' for different environments would be nice. Different gradle tasks with different configuration is now possible but needs to much code. Extra config files which override some values of the 'main'-config sound good to me. To decrease the parameters in the task definitions, I'm thinking about a kotlin DSL ( #19 ), so the only parameter for the CLI would be the path to the config path. But maybe just extending the yaml format would also be sufficient for now and spend the time on other features :) PS: today I implemented the '@Suppress' feature ( #6 ) which would be another cumbersome way to archive different naming conventions :D |
@scottkennedy You got this working for Android? |
Yes, this is how I have it set up:
Hmmm I'm thinking I have this backwards now, but you get the idea. |
@scottkennedy Thanks for the fast reply! I tried to apply it to an existing project and it failed: #69.
|
Android Gradle 2.3.2 |
Oh but I'm not using the detekt Gradle plugin. |
@scottkennedy Applying
|
@scottkennedy What do you mean? You have custom tasks and only have it on the classpath? |
I'm using it the same way I used it before there was a Gradle plugin. I couldn't get the plugin to work, and haven't had time to investigate. So yes, just the tasks, along with:
|
@scottkennedy Thank you. This is what I meant, you aren't "applying" it the to project itself, just using the jars. I can't get it to work either but I will try your way! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics. |
In tests, I like to have very specific method names that are human readable.
For example:
However, this is not valid in Android apps.
As such, it would be nice if I could specify a different configuration for the tests in my project.
The text was updated successfully, but these errors were encountered: