Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Detekt: Exception when output is null #70

Closed
tasomaniac opened this issue Feb 2, 2018 · 5 comments
Closed

Detekt: Exception when output is null #70

tasomaniac opened this issue Feb 2, 2018 · 5 comments
Labels

Comments

@tasomaniac
Copy link
Contributor

It seems that the output is not mandatory in detekt. When you don't have any output defined, it simply skips writing to files and only does console output.

But when it is integrated through our plugin, we just throw IllegalArgumentException with a cryptic message. Instead, maybe we should validate it and require output to be define.

Caused by: java.lang.IllegalArgumentException: path may not be null or empty string. path='null' at org.gradle.api.internal.file.AbstractBaseDirFileResolver.doResolve(AbstractBaseDirFileResolver.java:65) at org.gradle.api.internal.file.AbstractFileResolver.resolve(AbstractFileResolver.java:85) at org.gradle.api.internal.file.AbstractFileResolver.resolve(AbstractFileResolver.java:67) at org.gradle.api.internal.file.DefaultFileOperations.file(DefaultFileOperations.java:89) at org.gradle.api.internal.project.DefaultProject.file(DefaultProject.java:840) at org.gradle.api.Project$file$3.call(Unknown Source) at com.novoda.staticanalysis.internal.detekt.DetektConfigurator.createCollectViolationsTask(DetektConfigurator.groovy:67) at com.novoda.staticanalysis.internal.detekt.DetektConfigurator.configureToolTask(DetektConfigurator.groovy:61) at com.novoda.staticanalysis.internal.detekt.DetektConfigurator$_execute_closure1.doCall(DetektConfigurator.groovy:50)
@mr-archano
Copy link
Contributor

Good point @tasomaniac. To me this looks like a bug we need to fix.

@mr-archano mr-archano added the bug label Feb 2, 2018
@tasomaniac
Copy link
Contributor Author

tasomaniac commented Feb 2, 2018

Yep. This is something we should be better at with all tools.

We have some expectations from the user how to configure the tools. Having an output for detekt is only 1 example. And we should have clear error messages around those expectations.

@mr-archano
Copy link
Contributor

@tasomaniac is this issue supposed to track also the improvements for the other tools?

@tasomaniac
Copy link
Contributor Author

Fixed by #90

@tasomaniac
Copy link
Contributor Author

@mr-archano I just mentioned that but I cannot recall at the moment similar problems with other tools.

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

No branches or pull requests

2 participants