@@ -23,6 +23,7 @@ public final class PluginConfigurationBuilder {
23
23
private SortedSet <String > activeLocationIds ;
24
24
private boolean scanBeforeCheckin ;
25
25
private String lastActivePluginVersion ;
26
+ private boolean importSettingsFromMaven ;
26
27
27
28
private PluginConfigurationBuilder (@ NotNull final String checkstyleVersion ,
28
29
@ NotNull final ScanScope scanScope ,
@@ -32,7 +33,8 @@ private PluginConfigurationBuilder(@NotNull final String checkstyleVersion,
32
33
@ NotNull final List <String > thirdPartyClasspath ,
33
34
@ NotNull final SortedSet <String > activeLocationIds ,
34
35
final boolean scanBeforeCheckin ,
35
- @ Nullable final String lastActivePluginVersion ) {
36
+ @ Nullable final String lastActivePluginVersion ,
37
+ final boolean importSettingsFromMaven ) {
36
38
this .checkstyleVersion = checkstyleVersion ;
37
39
this .scanScope = scanScope ;
38
40
this .suppressErrors = suppressErrors ;
@@ -42,6 +44,7 @@ private PluginConfigurationBuilder(@NotNull final String checkstyleVersion,
42
44
this .activeLocationIds = activeLocationIds ;
43
45
this .scanBeforeCheckin = scanBeforeCheckin ;
44
46
this .lastActivePluginVersion = lastActivePluginVersion ;
47
+ this .importSettingsFromMaven = importSettingsFromMaven ;
45
48
}
46
49
47
50
public static PluginConfigurationBuilder defaultConfiguration (@ NotNull final Project project ) {
@@ -62,7 +65,8 @@ public static PluginConfigurationBuilder defaultConfiguration(@NotNull final Pro
62
65
Collections .emptyList (),
63
66
Collections .emptySortedSet (),
64
67
false ,
65
- CheckStylePlugin .version ());
68
+ CheckStylePlugin .version (),
69
+ false );
66
70
}
67
71
68
72
public static PluginConfigurationBuilder testInstance (@ NotNull final String checkstyleVersion ) {
@@ -75,7 +79,8 @@ public static PluginConfigurationBuilder testInstance(@NotNull final String chec
75
79
Collections .emptyList (),
76
80
Collections .emptySortedSet (),
77
81
false ,
78
- "aVersion" );
82
+ "aVersion" ,
83
+ false );
79
84
}
80
85
81
86
public static PluginConfigurationBuilder from (@ NotNull final PluginConfiguration source ) {
@@ -87,7 +92,8 @@ public static PluginConfigurationBuilder from(@NotNull final PluginConfiguration
87
92
source .getThirdPartyClasspath (),
88
93
source .getActiveLocationIds (),
89
94
source .isScanBeforeCheckin (),
90
- source .getLastActivePluginVersion ());
95
+ source .getLastActivePluginVersion (),
96
+ source .isImportSettingsFromMaven ());
91
97
}
92
98
93
99
public PluginConfigurationBuilder withCheckstyleVersion (@ NotNull final String newCheckstyleVersion ) {
@@ -135,6 +141,11 @@ public PluginConfigurationBuilder withLastActivePluginVersion(final String newLa
135
141
return this ;
136
142
}
137
143
144
+ public PluginConfigurationBuilder withImportSettingsFromMaven (final boolean importSettingsFromMaven ) {
145
+ this .importSettingsFromMaven = importSettingsFromMaven ;
146
+ return this ;
147
+ }
148
+
138
149
public PluginConfiguration build () {
139
150
return new PluginConfiguration (
140
151
checkstyleVersion ,
@@ -145,7 +156,8 @@ public PluginConfiguration build() {
145
156
Objects .requireNonNullElseGet (thirdPartyClasspath , ArrayList ::new ),
146
157
Objects .requireNonNullElseGet (activeLocationIds , TreeSet ::new ),
147
158
scanBeforeCheckin ,
148
- lastActivePluginVersion );
159
+ lastActivePluginVersion ,
160
+ importSettingsFromMaven );
149
161
}
150
162
151
163
private static ConfigurationLocationFactory configurationLocationFactory (final Project project ) {
0 commit comments