Vivek Krishnan
04/19/2021, 8:47 AMimport org.gradle.plugins.ide.idea.model.IdeaLanguageLevel
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.plugin.SpringBootPlugin
import org.springframework.boot.gradle.tasks.run.BootRun
plugins {
base
id("com.dorongold.task-tree") version "1.4"
id("org.springframework.boot") version "2.4.1" apply false
kotlin("jvm") version "1.4.21"
kotlin("plugin.spring") version "1.4.21" apply false
id("org.sonarqube") version "3.1.1"
idea
jacoco
id("io.gitlab.arturbosch.detekt") version "1.16.0" apply true
}
group = "com.abc.engine"
allprojects {
val runningOnGitlabCI = System.getenv("GITLAB_CI")?.toBoolean() == true
version = when {
runningOnGitlabCI -> System.getenv("CI_COMMIT_TAG") ?: System.getenv("CI_PIPELINE_ID") ?: "ci_undefined"
else -> "undefined"
}
repositories {
mavenCentral()
maven(url = "<https://oss.jfrog.org/artifactory/oss-snapshot-local/>")
jcenter()
}
}
val SRC_ENCODING = "UTF-8"
val SRC_VERSION = 11
idea {
project {
jdkName = "$SRC_VERSION"
languageLevel = IdeaLanguageLevel("$SRC_VERSION")
vcs = "Git"
}
module {
excludeDirs = excludeDirs + file(".gradle/")
}
}
subprojects {
apply(plugin = "kotlin")
apply(plugin = "jacoco")
apply(plugin = "detek")
// tasks.register()
// tasks.register("detektAll", io.gitlab.arturbosch.detekt.Detekt) {
// def autoFix = project.hasProperty('detektAutoFix')
//
// description = "Custom DETEKT build for all modules"
// parallel = true
// ignoreFailures = false
// autoCorrect = autoFix
// buildUponDefaultConfig = true
// setSource(projectSource)
// baseline.set(baselineFile)
// config.setFrom(configFile)
// include(kotlinFiles)
// exclude(resourceFiles, buildFiles)
// reports {
// html.enabled = true
// xml.enabled = false
// txt.enabled = false
// }
// }
// tasks.register("detektGenerateBaseline", io.gitlab.arturbosch.detekt.DetektCreateBaselineTask) {
// description = "Custom DETEKT build to build baseline for all modules"
// parallel = true
// ignoreFailures = false
// buildUponDefaultConfig = true
// setSource(projectSource)
// baseline.set(baselineFile)
// config.setFrom(configFile)
// include(kotlinFiles)
// exclude(resourceFiles, buildFiles)
// }
tasks.withType<Test>().configureEach {
useJUnitPlatform()
testLogging {
events("failed")
}
maxParallelForks = Runtime.getRuntime().availableProcessors()
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "11"
kotlinOptions.useIR = true
}
}
tasks.withType<BootRun>().configureEach {
val profiles = System.getenv("SPRING_PROFILES_ACTIVE")
if (profiles == null || profiles.trim() == "") {
val springProfilesActive = project.gradle.startParameter.systemPropertiesArgs["spring.profiles.active"]
?: "localdev"
args = ((args ?: emptyList()) + "--spring.profiles.active=$springProfilesActive")
}
jvmArgs = listOf("-Xmx512m")
}
tasks.check {
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.isEnabled = true
csv.isEnabled = false
html.isEnabled = false
}
}
// global dependencies configuration
dependencies {
"annotationProcessor"(platform(SpringBootPlugin.BOM_COORDINATES))
"implementation"(platform(SpringBootPlugin.BOM_COORDINATES))
"implementation"(enforcedPlatform("com.amazonaws:aws-java-sdk-bom:1.11.862")) // amazon v1 bom
"implementation"(enforcedPlatform("software.amazon.awssdk:bom:2.14.19")) // amazon v2 bom
"implementation"(kotlin("stdlib"))
"implementation"(kotlin("reflect"))
"compileOnly"(platform(SpringBootPlugin.BOM_COORDINATES))
"compileOnly"("org.springframework.boot:spring-boot-configuration-processor")
"testImplementation"(platform(SpringBootPlugin.BOM_COORDINATES))
"testImplementation"("org.junit.jupiter:junit-jupiter-api")
"testImplementation"("org.junit.jupiter:junit-jupiter-params")
"testRuntimeOnly"(platform(SpringBootPlugin.BOM_COORDINATES))
"testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine")
// "detektPlugins"("io.gitlab.arturbosch.detekt:detekt-formatting:1.16.0")
}
}
Sebastian Kaspari
04/27/2021, 8:10 AMkotlinx-html-jvm
to 0.7.3
which made it to Maven Central?Jakub Chrzanowski
04/28/2021, 8:16 AM1.16.1
with https://github.com/detekt/detekt/pull/3455 ?gammax
05/01/2021, 9:08 AM1.17.0-RC1
is out: https://github.com/detekt/detekt/releases/tag/v1.17.0-RC1
Please test it and report issues if you find any 🙏chao
05/15/2021, 11:00 PMmkrussel
05/25/2021, 9:08 PMval detektAll = tasks.register("detektAll") {
dependsOn(tasks.withType<io.gitlab.arturbosch.detekt.Detekt>())
}
iamthevoid
05/26/2021, 6:52 AMiamthevoid
05/26/2021, 7:17 AMArgumentListWrapping
checks?iamthevoid
05/27/2021, 10:02 AMMichael Marshall
06/07/2021, 2:02 AMbindingContext
okay, but getType
is always null
. What should I be doing to get the class of the object declaration?
override fun visitObjectDeclaration(declaration: KtObjectDeclaration) {
super.visitObjectDeclaration(declaration)
if (bindingContext == BindingContext.EMPTY) return
if (bindingContext.getType(declaration) is Serializable) {
report(
CodeSmell(
issue = issue,
entity = Entity.from(declaration),
message = "Do not use Java Serialization for Kotlin objects."
)
)
}
}
Piyush Kukadiya
06/07/2021, 7:22 AM./detekt-cli --plugins /Users/piyush.kukadiya/projects/sample/lint_rules_detekt/build/libs/lint_rules_detekt.jar
ThanksMichael Marshall
06/10/2021, 2:29 AM./gradlew detektMain
but I don't see any live errors while coding.pavlospt
06/11/2021, 7:38 AMAnkur Gupta
06/19/2021, 11:54 AMForbiddenComment
but I'm not sure how to customize it to check for the specific type of comments. Or do I need to make a new rule altogether, Please point me to the relevant path. Thanks!
Example comment I'm talking about:-
/**
* Created by Dev Name on 28/05/21.
*/
Example 2-
/*
* @Author: Dev name
* Email: <mailto:devname@company.com|devname@company.com>
*/
zmunm
06/22/2021, 1:50 AMUnusedPrivateMember
I checked that the relevant content has already been regressed, but how about skipping the operator if there is no type resolution?
In idea plugin, false positives seem to have a greater effect than ignoreMichael Marshall
06/23/2021, 6:19 AMdetekt-rules.jar
when I run ./gradlew detektMain
? The default location is detekt-rules/build/libs/detekt-rules.jar
but I want to move it to somewhere not auto ignored by gitbrent
06/25/2021, 1:34 PM--classpath
param to enable type resolution my execution time goes from a few minutes to ∞ and eventually an OOM crash.gammax
07/01/2021, 4:50 PM1,18.0-RC1
).
Specifically we’re waiting for Kotlin 1.5.21
to be out (or we might have to revert a Kotlin version bump).
I hope this is not ideal, but if you really need a new release out please let us know 👍Ivan Pavlov
07/02/2021, 12:12 PMsimon.vergauwen
07/19/2021, 1:37 PMJavier
07/19/2021, 1:47 PMNick
07/28/2021, 4:03 PMname: Android CI
on:
# Trigger on every pull request and push to the main branches.
push:
branches:
- "1.0"
- mo_ql
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Detekt
run: ./gradlew detektMain
- name: Build with Gradle
run: ./gradlew assemble
But when I run ./gradlew detektMain
locally, it works fine. The baselines are on Github in the same folders as seen in the screenshot.
Also…
./gradlew detekt
runs real quickly, and outputs nothing detekt related.
My config is the default generated one.
What did I do wrong?Karol Ksionek
07/29/2021, 10:55 AMdetekt {
input = files(escapedProjectDir)
baseline = file("$escapedRootProjectDir/config/detekt/detekt-baseline.xml")
config = files("$escapedRootProjectDir/config/detekt/detekt.yml")
autoCorrect = false
parallel = true
}
tasks.withType(io.gitlab.arturbosch.detekt.Detekt) {
exclude '**/resources/**'
exclude '**/build/**'
}
But it keeps checking build directory. What’s wrong?
I’m using detekt 1.18.0-RC2gammax
08/06/2021, 6:00 PM1.18.0-RC3
was just released: https://github.com/detekt/detekt/releases/tag/v1.18.0-RC3
Please help us test it and report any problems. Ideally we could release a stable next week if nothing major pops up.Javier
08/12/2021, 3:44 PMgammax
08/12/2021, 6:24 PMrobstoll
08/12/2021, 7:35 PMerror: the feature "multi platform projects" is experimental and should be enabled explicitly
How do I enable this explicitly could not find something on detekt.github.iorobstoll
08/12/2021, 8:31 PMrobstoll
08/12/2021, 8:51 PMoshai
08/15/2021, 2:08 PMio.gitlab.arturbosch.detekt
?