* Sets the following: *
* Default path: {@code default-detekt-config.yml}
*
* @param generate {@code true} or {@code false}
* @return this operation instance
*/
public DetektOperation generateConfig(boolean generate) {
generateConfig_ = generate;
return this;
}
// Retrieves the matching JARs files from the given directory.
private String getDetektJarList(File directory) {
var jars = new ArrayList
* Default: 1.8
*
* @param target the target version
* @return this operation instance
*/
public DetektOperation jvmTarget(String target) {
jvmTarget_ = target;
return this;
}
/**
* EXPERIMENTAL: Compatibility mode for Kotlin language version X.Y,
* reports errors for all language features that came out later.
*
* Possible Values: [1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1]
*
* @param version the version
* @return this operation instance
*/
public DetektOperation languageVersion(String version) {
languageVersion_ = version;
return this;
}
/**
* Return exit code 0 only when found issues count does not exceed
* specified issues count.
*
* @param max the issues code
* @return this operation instance
*/
public DetektOperation maxIssues(int max) {
maxIssues_ = max;
return this;
}
/**
* Enables parallel compilation and analysis of source files. Do some
* benchmarks first before enabling this flag. Heuristics show performance
* benefits starting from 2000 lines of Kotlin code.
*
* @param parallel {@code true} or {@code false}
* @return this operation instance
*/
public DetektOperation parallel(boolean parallel) {
parallel_ = parallel;
return this;
}
/**
* Extra paths to plugin jars.
*
* @param jars one or more jars
* @return this operation instance
*/
public DetektOperation plugins(String... jars) {
plugins_.addAll(Arrays.stream(jars).map(File::new).toList());
return this;
}
/**
* Extra paths to plugin jars.
*
* @param jars one or more jars
* @return this operation instance
*/
public DetektOperation plugins(File... jars) {
plugins_.addAll(List.of(jars));
return this;
}
/**
* Extra paths to plugin jars.
*
* @param jars the jars paths
* @return this operation instance
*/
public DetektOperation plugins(Collection