File tree 2 files changed +9
-2
lines changed
java/io/gitlab/arturbosch/detekt/config
kotlin/io/gitlab/arturbosch/detekt/config
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 30
30
</constraints >
31
31
<properties >
32
32
<text value =" " />
33
- <toolTipText value =" Path to detekt configuration file" />
33
+ <toolTipText value =" Path to detekt configuration file. A relative path can be used, and will be relative to project directory. " />
34
34
</properties >
35
35
</component >
36
36
</children >
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import com.intellij.openapi.components.Storage
7
7
import com.intellij.openapi.components.StoragePathMacros
8
8
import com.intellij.openapi.project.Project
9
9
import com.intellij.util.xmlb.annotations.Tag
10
+ import java.io.File
10
11
11
12
/* *
12
13
* @author Dmytro Primshyts
@@ -15,7 +16,7 @@ import com.intellij.util.xmlb.annotations.Tag
15
16
name = " DetektProjectConfiguration" ,
16
17
storages = [(Storage (StoragePathMacros .WORKSPACE_FILE ))]
17
18
)
18
- class DetektConfigStorage : PersistentStateComponent <DetektConfigStorage > {
19
+ class DetektConfigStorage ( val project : Project ) : PersistentStateComponent<DetektConfigStorage> {
19
20
20
21
@Tag
21
22
var enableDetekt: Boolean = false
@@ -34,6 +35,12 @@ class DetektConfigStorage : PersistentStateComponent<DetektConfigStorage> {
34
35
35
36
@Tag
36
37
var rulesPath: String = " "
38
+ set(value) {
39
+ field = if (value.isBlank() || File (value).isAbsolute)
40
+ value
41
+ else
42
+ project.basePath + " /" + value
43
+ }
37
44
38
45
override fun getState (): DetektConfigStorage ? = this
39
46
You can’t perform that action at this time.
0 commit comments