Qracle
12/30/2019, 3:15 AMken
12/31/2019, 9:02 AMkenkyee
01/02/2020, 6:28 PM**/test/**,**/*Test.kt,**/*Spec.kt"
folder (this is valid only if you were using the default config file)"
ahh...FWIW, it was nicer having the excludes in one place since now it means you need to duplicate the excludes glob match list in a bunch of places.
We did it for comments and these:
- 'NamingRules'
- 'WildcardImport'
- 'MagicNumber'
- 'MaxLineLength'
- 'LateinitUsage'
- 'StringLiteralDuplication'
- 'SpreadOperator'
- 'TooManyFunctions'
- 'ForEachOnRange'
- 'FunctionMaxLength'
Looks like the default only does comments and:
StringLiteralDuplication and TooManyFunctionskpgalligan
01/02/2020, 9:40 PMdetektPlugins
as a valid configurationkenkyee
01/03/2020, 10:10 PMbbaldino
01/07/2020, 10:04 PMArtur Bosch
01/12/2020, 5:57 PMbrent
01/14/2020, 7:11 PM1.0.0-RC146
to 1.4.0
. Mostly working, but many of the rules simply aren't running. Looking through GH issues I see work was done around "type resolution" in v 1.1
. Is this working on multi-module Android projects yet? I see this comment from back in October with no corresponding PRs since: https://github.com/arturbosch/detekt/issues/2036#issuecomment-544105669bbaldino
01/21/2020, 5:45 AM${...}
in the compiled test code? If I do:
val code = """
fun foo() {
println("The list is ${listOf(1, 2, 3)}"
}
""".trimIndent()
assertThat(subject.compileAndLintWithContext(wrapper.env, code)).hasSize(0)
then the compiled ktFile
has the list expanded, but if I do:
val code = """
fun foo() {
println("The list is \$\{listOf(1, 2, 3)\}"
}
""".trimIndent()
assertThat(subject.compileAndLintWithContext(wrapper.env, code)).hasSize(0)
then the compiled ktFile
maintains the escape characters, so the code isn't actually doing the expansionenighma
01/24/2020, 11:08 PMBindingContextUtils
seems to provide the functionality I'm after, but I can't figure out how to get a BindingContext.
seb
01/28/2020, 8:37 AMWill Hawkins
02/03/2020, 9:40 PMWill Hawkins
02/03/2020, 9:45 PMCody Engel
02/04/2020, 7:14 PMexcludes: "**/*Test.kt"
https://arturbosch.github.io/detekt/howto-migratetestpattern.htmlzmoore
02/13/2020, 7:01 AMHardik Trivedi
02/16/2020, 1:41 PMokue
02/17/2020, 11:05 AMLuke
03/04/2020, 8:58 PMdetektBaseline
and detekt
finish successfully in 1 second and nothing else happens, even though I know for a fact that the code contains errors. The only way I had it working was by creating my own Gradle tasks, but I don’t want to do this if I don’t have to. I have this in my project-level Gradle:
plugins {
id "io.gitlab.arturbosch.detekt" version "1.6.0"
}
detekt {
toolVersion = "1.6.0"
config = files("$projectDir/config/detekt/detekt.yml")
baseline = file("$projectDir/config/detekt/baseline.xml")
// source = files("src/main/kotlin") // This does not work for some reasons (Could not set unknown property 'source' for object of type io.gitlab.arturbosch.detekt.extensions.DetektExtension.)
buildUponDefaultConfig = true
parallel = true
ignoreFailures = true
reports {
txt.enabled = false
xml.enabled = false
html {
enabled = true
destination = file("$projectDir/reports/detekt/report.html")
}
}
}
r4zzz4k
03/05/2020, 2:51 PMLongParameterList
is the nearest thing, but it covers only methods.
I've tried to cover constructors there (https://github.com/r4zzz4k/detekt/commit/1cf853c), but ./gradlew check
finds issues with existing code after that (https://github.com/arturbosch/detekt/blob/521e968/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/CodeSmell.kt#L44-L51).
So two questions:
1. Does this sound like a useful rule? In discussions over the Internet on argument count limit I mostly see costructors included. Checktyle, for example, also covers both methods and parameters (https://checkstyle.sourceforge.io/apidocs/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheck.html), PMD seems to agree on that (https://stackoverflow.com/q/56492868/2475207).
2. What's the flow for contributing rules which don't validate current code? Seems that check
task completes successfully on the project itself.
3. Are there any general contribution guidelines described somewhere I've missed?r4zzz4k
03/05/2020, 2:53 PM./gradlew check
on my local branch:
Execution failed for task ':detekt-api:detekt'.
> io.gitlab.arturbosch.detekt.api.RuleSetProvider: Error reading configuration file
...
Caused by: java.util.ServiceConfigurationError: io.gitlab.arturbosch.detekt.api.RuleSetProvider: Error reading configuration file
at io.gitlab.arturbosch.detekt.core.RuleSetLocator.load(RuleSetLocator.kt:29)
at io.gitlab.arturbosch.detekt.cli.config.DefaultPropertiesConfigValidator$validate$1.invoke(DefaultPropertiesConfigValidator.kt:20)
at io.gitlab.arturbosch.detekt.cli.config.DefaultPropertiesConfigValidator.validate(DefaultPropertiesConfigValidator.kt:27)
at io.gitlab.arturbosch.detekt.cli.config.ConfigValidatorsKt.checkConfiguration(ConfigValidators.kt:18)
at io.gitlab.arturbosch.detekt.cli.runners.Runner.execute(Runner.kt:30)
at io.gitlab.arturbosch.detekt.invoke.DefaultCliInvoker.invokeCli(DetektInvoker.kt:51)
... 93 more
Caused by: java.util.zip.ZipException: invalid distance too far back
... 99 more
Not sure if I'm doing something wrong or this is an issue to be reported.
Just in case this helps: Ubuntu 19.10,
> java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)
chao
03/15/2020, 8:21 PMBryan Lindsey
03/16/2020, 5:27 PMMake sure to specify theThis seems to be partially true. It does seem to run if you don't have a separate config YAML file. I updated the input as per that page and it works well enough for now. Still confusing that it can run without it in some scenarios.parameter or no sources are found and detekt won’t run!input
zmoore
03/19/2020, 10:17 PMMichael Friend
03/20/2020, 1:09 PM<ID>NoBlankLineBeforeRbrace:</ID>
without a reference to a part of the codebase. This seems to cause detekt to ignore the rule entirely in that module rather than just ignore existing instances of violations. Is this expected behavior and is there any way to prevent this from being generated?Joe
03/24/2020, 1:15 AM--config-resource detekt-config.yml
to read a config file out of a jar on the classpath. running detekt via maven antrun plugin. works fine in 1.6.0. anyone else seen anything like this?
java.nio.file.FileSystemNotFoundException
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:169)
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:155)
at java.base/java.nio.file.Path.of(Path.java:208)
at java.base/java.nio.file.Paths.get(Paths.java:97)
at io.gitlab.arturbosch.detekt.rules.documentation.LicenceHeaderLoaderExtension.init(LicenceHeaderLoaderExtension.kt:27)
at io.gitlab.arturbosch.detekt.core.FileProcessorLocator.load(FileProcessorLocator.kt:18)
at io.gitlab.arturbosch.detekt.core.DetektFacade$Companion.create(DetektFacade.kt:90)
at io.gitlab.arturbosch.detekt.cli.runners.Runner.execute(Runner.kt:33)
at io.gitlab.arturbosch.detekt.cli.Main.main(Main.kt:20)
gammax
03/25/2020, 4:32 PMSeverity.Warning
on the Issue
class that I can set for each issue that I report on a my rule. The problem is that those issues are counted towards the total number of issues used to let Detekt fail or not.
Anyone faced a similar scenario?sanogueralorenzo
03/29/2020, 3:04 AMsanogueralorenzo
03/31/2020, 4:55 AMseb
03/31/2020, 1:57 PMgammax
03/31/2020, 2:10 PMif (bindingContext == BindingContext.EMPTY) return
in the body of the rule source code, they need type resolutions to work. They will be skipped otherwise.gammax
03/31/2020, 2:10 PMif (bindingContext == BindingContext.EMPTY) return
in the body of the rule source code, they need type resolutions to work. They will be skipped otherwise.dead.fish
03/31/2020, 2:19 PM