Skip to content

Commit 538dc0f

Browse files
committed
Remove update notification as IDEA now notifies when plugins are updated
1 parent 261c0a0 commit 538dc0f

File tree

9 files changed

+11
-179
lines changed

9 files changed

+11
-179
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# CheckStyle-IDEA Changelog
33

44
* **5.112.0** Fixed: Keep focus in tool window when scrolling result, matching find results behaviour (#676).
5+
* **5.112.0** Removed: Removed update notification, as IDEA now notifies when plugins are updated.
56
* **5.112.0** New: Added Checkstyle 11.1.0.
67
* **5.111.1** Fixed: Removed scope check when enabling scan current file button to improve performance (#675).
78
* **5.111.1** New: Add keyboard shortcuts for next/previous result (#676).

src/main/java/org/infernus/idea/checkstyle/config/ApplicationConfigurationState.java

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/main/java/org/infernus/idea/checkstyle/config/PluginConfiguration.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import org.infernus.idea.checkstyle.model.ConfigurationLocation;
55
import org.infernus.idea.checkstyle.model.ScanScope;
66
import org.jetbrains.annotations.NotNull;
7-
import org.jetbrains.annotations.Nullable;
87

98
import java.util.*;
109
import java.util.stream.Collectors;
@@ -25,7 +24,6 @@ public class PluginConfiguration {
2524
private final List<String> thirdPartyClasspath;
2625
private final SortedSet<String> activeLocationIds;
2726
private final boolean scanBeforeCheckin;
28-
private final String lastActivePluginVersion;
2927

3028
PluginConfiguration(@NotNull final String checkstyleVersion,
3129
@NotNull final ScanScope scanScope,
@@ -35,8 +33,7 @@ public class PluginConfiguration {
3533
@NotNull final SortedSet<ConfigurationLocation> locations,
3634
@NotNull final List<String> thirdPartyClasspath,
3735
@NotNull final SortedSet<String> activeLocationIds,
38-
final boolean scanBeforeCheckin,
39-
@Nullable final String lastActivePluginVersion) {
36+
final boolean scanBeforeCheckin) {
4037
this.checkstyleVersion = checkstyleVersion;
4138
this.scanScope = scanScope;
4239
this.suppressErrors = suppressErrors;
@@ -48,7 +45,6 @@ public class PluginConfiguration {
4845
.filter(Objects::nonNull)
4946
.collect(Collectors.toCollection(TreeSet::new));
5047
this.scanBeforeCheckin = scanBeforeCheckin;
51-
this.lastActivePluginVersion = lastActivePluginVersion;
5248
}
5349

5450
@NotNull
@@ -90,11 +86,6 @@ public List<String> getThirdPartyClasspath() {
9086
return thirdPartyClasspath;
9187
}
9288

93-
@Nullable
94-
public String getLastActivePluginVersion() {
95-
return lastActivePluginVersion;
96-
}
97-
9889
public SortedSet<String> getActiveLocationIds() {
9990
return this.activeLocationIds;
10091
}
@@ -146,14 +137,13 @@ public boolean equals(final Object other) {
146137
&& Objects.equals(locations, otherDto.locations)
147138
&& Objects.equals(thirdPartyClasspath, otherDto.thirdPartyClasspath)
148139
&& Objects.equals(activeLocationIds, otherDto.activeLocationIds)
149-
&& Objects.equals(scanBeforeCheckin, otherDto.scanBeforeCheckin)
150-
&& Objects.equals(lastActivePluginVersion, otherDto.lastActivePluginVersion);
140+
&& Objects.equals(scanBeforeCheckin, otherDto.scanBeforeCheckin);
151141
}
152142

153143
@Override
154144
public int hashCode() {
155145
return Objects.hash(checkstyleVersion, scanScope, suppressErrors, copyLibs, scrollToSource,
156-
locations, thirdPartyClasspath, activeLocationIds, scanBeforeCheckin, lastActivePluginVersion);
146+
locations, thirdPartyClasspath, activeLocationIds, scanBeforeCheckin);
157147
}
158148

159149
}

src/main/java/org/infernus/idea/checkstyle/config/PluginConfigurationBuilder.java

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
package org.infernus.idea.checkstyle.config;
22

33
import com.intellij.openapi.project.Project;
4-
import org.infernus.idea.checkstyle.CheckStylePlugin;
54
import org.infernus.idea.checkstyle.VersionListReader;
65
import org.infernus.idea.checkstyle.csapi.BundledConfig;
76
import org.infernus.idea.checkstyle.model.ConfigurationLocation;
87
import org.infernus.idea.checkstyle.model.ConfigurationLocationFactory;
98
import org.infernus.idea.checkstyle.model.ScanScope;
109
import org.infernus.idea.checkstyle.util.OS;
1110
import org.jetbrains.annotations.NotNull;
12-
import org.jetbrains.annotations.Nullable;
1311

1412
import java.util.*;
1513

@@ -23,7 +21,6 @@ public final class PluginConfigurationBuilder {
2321
private List<String> thirdPartyClasspath;
2422
private SortedSet<String> activeLocationIds;
2523
private boolean scanBeforeCheckin;
26-
private String lastActivePluginVersion;
2724

2825
private PluginConfigurationBuilder(@NotNull final String checkstyleVersion,
2926
@NotNull final ScanScope scanScope,
@@ -33,8 +30,7 @@ private PluginConfigurationBuilder(@NotNull final String checkstyleVersion,
3330
@NotNull final SortedSet<ConfigurationLocation> locations,
3431
@NotNull final List<String> thirdPartyClasspath,
3532
@NotNull final SortedSet<String> activeLocationIds,
36-
final boolean scanBeforeCheckin,
37-
@Nullable final String lastActivePluginVersion) {
33+
final boolean scanBeforeCheckin) {
3834
this.checkstyleVersion = checkstyleVersion;
3935
this.scanScope = scanScope;
4036
this.suppressErrors = suppressErrors;
@@ -44,7 +40,6 @@ private PluginConfigurationBuilder(@NotNull final String checkstyleVersion,
4440
this.thirdPartyClasspath = thirdPartyClasspath;
4541
this.activeLocationIds = activeLocationIds;
4642
this.scanBeforeCheckin = scanBeforeCheckin;
47-
this.lastActivePluginVersion = lastActivePluginVersion;
4843
}
4944

5045
public static PluginConfigurationBuilder defaultConfiguration(@NotNull final Project project) {
@@ -65,8 +60,7 @@ public static PluginConfigurationBuilder defaultConfiguration(@NotNull final Pro
6560
defaultLocations,
6661
Collections.emptyList(),
6762
Collections.emptySortedSet(),
68-
false,
69-
CheckStylePlugin.version());
63+
false);
7064
}
7165

7266
public static PluginConfigurationBuilder testInstance(@NotNull final String checkstyleVersion) {
@@ -79,8 +73,7 @@ public static PluginConfigurationBuilder testInstance(@NotNull final String chec
7973
Collections.emptySortedSet(),
8074
Collections.emptyList(),
8175
Collections.emptySortedSet(),
82-
false,
83-
"aVersion");
76+
false);
8477
}
8578

8679
public static PluginConfigurationBuilder from(@NotNull final PluginConfiguration source) {
@@ -92,8 +85,7 @@ public static PluginConfigurationBuilder from(@NotNull final PluginConfiguration
9285
source.getLocations(),
9386
source.getThirdPartyClasspath(),
9487
source.getActiveLocationIds(),
95-
source.isScanBeforeCheckin(),
96-
source.getLastActivePluginVersion());
88+
source.isScanBeforeCheckin());
9789
}
9890

9991
public PluginConfigurationBuilder withCheckstyleVersion(@NotNull final String newCheckstyleVersion) {
@@ -141,11 +133,6 @@ public PluginConfigurationBuilder withScanScope(@NotNull final ScanScope newScan
141133
return this;
142134
}
143135

144-
public PluginConfigurationBuilder withLastActivePluginVersion(final String newLastActivePluginVersion) {
145-
this.lastActivePluginVersion = newLastActivePluginVersion;
146-
return this;
147-
}
148-
149136
public PluginConfiguration build() {
150137
return new PluginConfiguration(
151138
checkstyleVersion,
@@ -156,8 +143,7 @@ public PluginConfiguration build() {
156143
Objects.requireNonNullElseGet(locations, TreeSet::new),
157144
Objects.requireNonNullElseGet(thirdPartyClasspath, ArrayList::new),
158145
Objects.requireNonNullElseGet(activeLocationIds, TreeSet::new),
159-
scanBeforeCheckin,
160-
lastActivePluginVersion);
146+
scanBeforeCheckin);
161147
}
162148

163149
private static ConfigurationLocationFactory configurationLocationFactory(final Project project) {

src/main/java/org/infernus/idea/checkstyle/config/PluginConfigurationManager.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.infernus.idea.checkstyle.config;
22

3-
import com.intellij.openapi.application.ApplicationManager;
43
import com.intellij.openapi.project.Project;
54
import org.jetbrains.annotations.NotNull;
65

@@ -43,13 +42,12 @@ public void disableActiveConfiguration() {
4342
public PluginConfiguration getCurrent() {
4443
final PluginConfigurationBuilder defaultConfig = PluginConfigurationBuilder.defaultConfiguration(project);
4544
return projectConfigurationState()
46-
.populate(applicationConfigurationState().populate(defaultConfig))
45+
.populate(defaultConfig)
4746
.build();
4847
}
4948

5049
public void setCurrent(@NotNull final PluginConfiguration updatedConfiguration, final boolean fireEvents) {
5150
projectConfigurationState().setCurrentConfig(updatedConfiguration);
52-
applicationConfigurationState().setCurrentConfig(updatedConfiguration);
5351
if (fireEvents) {
5452
fireConfigurationChanged();
5553
}
@@ -58,8 +56,4 @@ public void setCurrent(@NotNull final PluginConfiguration updatedConfiguration,
5856
private ProjectConfigurationState projectConfigurationState() {
5957
return project.getService(ProjectConfigurationState.class);
6058
}
61-
62-
private ApplicationConfigurationState applicationConfigurationState() {
63-
return ApplicationManager.getApplication().getService(ApplicationConfigurationState.class);
64-
}
6559
}

src/main/java/org/infernus/idea/checkstyle/startup/NotifyUserIfPluginUpdated.java

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<![CDATA[
2727
<ul>
2828
<li>5.112.0: Fixed: Keep focus in tool window when scrolling result, matching find results behaviour (#676).</li>
29+
<li>5.112.0: Removed: Removed update notification, as IDEA now notifies when plugins are updated.</li>
2930
<li>5.112.0: New: Added Checkstyle 11.1.0.</li>
3031
<li>5.111.1: Fixed: Removed scope check when enabling scan current file button to improve performance (#675).</li>
3132
<li>5.111.1: New: Add keyboard shortcuts for next/previous result (#676).</li>
@@ -44,17 +45,12 @@
4445
<li>5.104.1: Fixed: Code importer now correctly parses tokens in newer Google configurations (#657).</li>
4546
<li>5.104.0: New: Added Checkstyle 10.22.0 (#661).</li>
4647
<li>5.103.0: New: Added Checkstyle 10.21.3.</li>
47-
<li>5.102.0: New: Added Checkstyle 10.21.2.</li>
48-
<li>5.101.0: New: Added Checkstyle 10.21.1.</li>
49-
<li>5.100.0: New: Added Checkstyle 10.21.0.</li>
5048
<li><em>For older changes please see the changelog.</em></li>
5149
</ul>
5250
]]>
5351
</change-notes>
5452

5553
<extensions defaultExtensionNs="com.intellij">
56-
<applicationService serviceImplementation="org.infernus.idea.checkstyle.config.ApplicationConfigurationState"/>
57-
5854
<projectService serviceImplementation="org.infernus.idea.checkstyle.StaticScanner"/>
5955
<projectService serviceImplementation="org.infernus.idea.checkstyle.checker.CheckerFactoryCache"/>
6056
<projectService serviceImplementation="org.infernus.idea.checkstyle.checker.CheckerFactory"/>
@@ -68,7 +64,6 @@
6864
<projectService serviceImplementation="org.infernus.idea.checkstyle.util.ProjectFilePaths"/>
6965
<projectService serviceImplementation="org.infernus.idea.checkstyle.ConfigurationInvalidator"/>
7066

71-
<postStartupActivity implementation="org.infernus.idea.checkstyle.startup.NotifyUserIfPluginUpdated"/>
7267
<postStartupActivity implementation="org.infernus.idea.checkstyle.startup.DisableCheckstyleLogging"/>
7368

7469
<projectConfigurable key="plugin.configuration-name"

src/main/resources/org/infernus/idea/checkstyle/CheckStyleBundle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ plugin.Checkstyle-IDEA.description=<p>This plugin provides both real-time \
4646
IDE.</p>
4747
plugin.debugging=The IDEA classpath is inconsistent, which probably means we're debugging. The classpath will be parent-first, which will break some breaks in some circumstances.
4848
plugin.update=Checkstyle-IDEA has been updated
49-
plugin.update.action=View release notes
5049
plugin.notification.alerts=Checkstyle IDEA Alerts
5150
plugin.notification.logging=Checkstyle IDEA Logging
5251
plugin.exception=Unexpected Exception Caught

src/test/java/org/infernus/idea/checkstyle/config/ModuleConfigurationStateTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,8 @@ public void configureMocks() {
5353
when(project.getService(ProjectFilePaths.class)).thenReturn(projectFilePaths);
5454
when(project.getService(PluginConfigurationManager.class)).thenReturn(pluginConfigurationManager);
5555

56-
final ApplicationConfigurationState applicationConfigurationState = new ApplicationConfigurationState();
5756
final Application application = mock(Application.class);
5857
when(application.isUnitTestMode()).thenReturn(true);
59-
when(application.getService(ApplicationConfigurationState.class)).thenReturn(applicationConfigurationState);
6058
ApplicationManager.setApplication(application, mock(Disposable.class));
6159

6260
ProjectConfigurationState projectConfigurationState = new ProjectConfigurationState(project);

0 commit comments

Comments
 (0)