Skip to content

Commit f1f3c45

Browse files
committed
Issue #614: Suppress all Idea Inspection violations
1 parent c8e12da commit f1f3c45

File tree

4 files changed

+98
-21
lines changed

4 files changed

+98
-21
lines changed

releasenotes-builder/src/main/java/com/github/checkstyle/MainProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private MainProcess() {
7575
* @throws IOException if I/O error occurs.
7676
* @throws TemplateException if an error occurs while generating freemarker template.
7777
*/
78-
public static List<String> run(Multimap<String, ReleaseNotesMessage> releaseNotes,
78+
public static List<String> runMainProcess(Multimap<String, ReleaseNotesMessage> releaseNotes,
7979
CliOptions cliOptions) throws IOException, TemplateException {
8080
runPostGeneration(releaseNotes, cliOptions);
8181
return runPostPublication(cliOptions);

releasenotes-builder/src/main/java/com/github/checkstyle/publishers/MailingListPublisher.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ public MailingListPublisher(String postFilename, String username, String passwor
8585
*/
8686
public void publish() throws MessagingException, IOException {
8787
final Properties props = System.getProperties();
88-
props.put("mail.smtp.starttls.enable", true);
89-
props.put("mail.smtp.host", SMTP_HOST);
90-
props.put("mail.smtp.user", username);
91-
props.put("mail.smtp.password", password);
92-
props.put("mail.smtp.port", SMTP_PORT);
93-
props.put("mail.smtp.auth", true);
88+
props.setProperty("mail.smtp.starttls.enable", String.valueOf(Boolean.TRUE));
89+
props.setProperty("mail.smtp.host", SMTP_HOST);
90+
props.setProperty("mail.smtp.user", username);
91+
props.setProperty("mail.smtp.password", password);
92+
props.setProperty("mail.smtp.port", SMTP_PORT);
93+
props.setProperty("mail.smtp.auth", String.valueOf(Boolean.TRUE));
9494

9595
final Session session = Session.getInstance(props, null);
9696
final MimeMessage mimeMessage = new MimeMessage(session);

releasenotes-builder/src/test/java/com/github/checkstyle/github/CommitMessageTest.java

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,29 @@
2424

2525
public class CommitMessageTest {
2626

27+
/**
28+
* @noinspection JUnitTestMethodWithNoAssertions
29+
*/
2730
@Test
2831
public void testIssue() {
2932
final CommitMessage message = new CommitMessage(
3033
"Issue #1487: workaround for cobertura at CheckstyleAntTask.java to get 100% coverage");
3134
Assert.assertTrue("Message should match issue/pull pattern", message.isIssueOrPull());
3235
}
3336

37+
/**
38+
* @noinspection JUnitTestMethodWithNoAssertions
39+
*/
3440
@Test
3541
public void testPull() {
3642
final CommitMessage message = new CommitMessage(
3743
"Pull #9314: fix escaped char pattern in AvoidEscapedUnicodeCharactersCheck");
3844
Assert.assertTrue("Message should match issue/pull pattern", message.isIssueOrPull());
3945
}
4046

47+
/**
48+
* @noinspection JUnitTestMethodWithNoAssertions
49+
*/
4150
@Test
4251
public void testRevert() {
4352
final CommitMessage message = new CommitMessage(
@@ -52,6 +61,9 @@ public void testRevert() {
5261
"5fe5bcee40e39eb6a23864f7f55128cbf2f10641", message.getRevertedCommitReference());
5362
}
5463

64+
/**
65+
* @noinspection JUnitTestMethodWithNoAssertions
66+
*/
5567
@Test
5668
public void testRevertNotInBeginningOfMessage() {
5769
final CommitMessage message = new CommitMessage(
@@ -61,34 +73,49 @@ public void testRevertNotInBeginningOfMessage() {
6173
Assert.assertTrue("Message should match revert pattern", message.isRevert());
6274
}
6375

76+
/**
77+
* @noinspection JUnitTestMethodWithNoAssertions
78+
*/
6479
@Test
6580
public void testReleaseIsIgnored() {
6681
final CommitMessage message = new CommitMessage(
6782
"[maven-release-plugin] prepare release checkstyle-8.35");
6883
Assert.assertTrue("Message should match ignore pattern", message.isIgnored());
6984
}
7085

86+
/**
87+
* @noinspection JUnitTestMethodWithNoAssertions
88+
*/
7189
@Test
7290
public void testUpdateToIsIgnored() {
7391
final CommitMessage message = new CommitMessage(
7492
"update to 7.0-SNAPSHOT");
7593
Assert.assertTrue("Message should match ignore pattern", message.isIgnored());
7694
}
7795

96+
/**
97+
* @noinspection JUnitTestMethodWithNoAssertions
98+
*/
7899
@Test
79100
public void testDocReleaseNotesIsIgnored() {
80101
final CommitMessage message = new CommitMessage(
81102
"doc: release notes 8.43");
82103
Assert.assertTrue("Message should match ignore pattern", message.isIgnored());
83104
}
84105

106+
/**
107+
* @noinspection JUnitTestMethodWithNoAssertions
108+
*/
85109
@Test
86110
public void testConfigIsIgnored() {
87111
final CommitMessage message = new CommitMessage(
88112
"config: update to 8.42-SNAPSHOT");
89113
Assert.assertTrue("Message should match ignore pattern", message.isIgnored());
90114
}
91115

116+
/**
117+
* @noinspection JUnitTestMethodWithNoAssertions
118+
*/
92119
@Test
93120
public void testDependencyIsIgnored() {
94121
final CommitMessage message = new CommitMessage(
@@ -111,27 +138,39 @@ public void testDependencyIsIgnored() {
111138
Assert.assertTrue("Message should match ignore pattern", message.isIgnored());
112139
}
113140

141+
/**
142+
* @noinspection JUnitTestMethodWithNoAssertions
143+
*/
114144
@Test
115145
public void testInfraIsIgnored() {
116146
final CommitMessage message = new CommitMessage(
117147
"infra: update README to have links to travis.com");
118148
Assert.assertTrue("Message should match ignore pattern", message.isIgnored());
119149
}
120150

151+
/**
152+
* @noinspection JUnitTestMethodWithNoAssertions
153+
*/
121154
@Test
122155
public void testMinorIsIgnored() {
123156
final CommitMessage message = new CommitMessage(
124157
"minor: refactor boolean expression to fix TC build");
125158
Assert.assertTrue("Message should match ignore pattern", message.isIgnored());
126159
}
127160

161+
/**
162+
* @noinspection JUnitTestMethodWithNoAssertions
163+
*/
128164
@Test
129165
public void testSupplementalIsIgnored() {
130166
final CommitMessage message = new CommitMessage(
131167
"supplemental: divide description into paragraph for Issue #8928");
132168
Assert.assertTrue("Message should match ignore pattern", message.isIgnored());
133169
}
134170

171+
/**
172+
* @noinspection JUnitTestMethodWithNoAssertions
173+
*/
135174
@Test
136175
public void testMarkersNotInBeginningOfMessage() {
137176
final CommitMessage message = new CommitMessage(
@@ -148,6 +187,9 @@ public void testMarkersNotInBeginningOfMessage() {
148187
Assert.assertFalse("Message should not match ignore pattern", message.isIgnored());
149188
}
150189

190+
/**
191+
* @noinspection JUnitTestMethodWithNoAssertions
192+
*/
151193
@Test
152194
public void testUnclassifiedCommit() {
153195
final CommitMessage message = new CommitMessage(

releasenotes-builder/src/test/java/com/github/checkstyle/templates/TemplateProcessorTest.java

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,12 @@ public void setup() throws IOException {
6060
temporaryFolder.create();
6161
}
6262

63+
/**
64+
* @noinspection JUnitTestMethodWithNoAssertions
65+
*/
6366
@Test
6467
public void testGenerateOnlyBreakingCompatibility() throws Exception {
65-
final List<String> errors = MainProcess.run(
68+
final List<String> errors = MainProcess.runMainProcess(
6669
createNotes(createAllNotes(), null, null, null, null), createBaseCliOptions()
6770
.setGenerateAll(true).build());
6871

@@ -75,9 +78,12 @@ public void testGenerateOnlyBreakingCompatibility() throws Exception {
7578
assertFile("githubPageBreakingCompatibility.txt", MainProcess.GITHUB_FILENAME);
7679
}
7780

81+
/**
82+
* @noinspection JUnitTestMethodWithNoAssertions
83+
*/
7884
@Test
7985
public void testGenerateOnlyNewFeature() throws Exception {
80-
final List<String> errors = MainProcess.run(
86+
final List<String> errors = MainProcess.runMainProcess(
8187
createNotes(null, createAllNotes(), null, null, null), createBaseCliOptions()
8288
.setGenerateAll(true).build());
8389

@@ -90,9 +96,12 @@ public void testGenerateOnlyNewFeature() throws Exception {
9096
assertFile("githubPageNew.txt", MainProcess.GITHUB_FILENAME);
9197
}
9298

99+
/**
100+
* @noinspection JUnitTestMethodWithNoAssertions
101+
*/
93102
@Test
94103
public void testGenerateOnlyBug() throws Exception {
95-
final List<String> errors = MainProcess.run(
104+
final List<String> errors = MainProcess.runMainProcess(
96105
createNotes(null, null, createAllNotes(), null, null), createBaseCliOptions()
97106
.setGenerateAll(true).build());
98107

@@ -105,9 +114,12 @@ public void testGenerateOnlyBug() throws Exception {
105114
assertFile("githubPageBug.txt", MainProcess.GITHUB_FILENAME);
106115
}
107116

117+
/**
118+
* @noinspection JUnitTestMethodWithNoAssertions
119+
*/
108120
@Test
109121
public void testGenerateOnlyMisc() throws Exception {
110-
final List<String> errors = MainProcess.run(
122+
final List<String> errors = MainProcess.runMainProcess(
111123
createNotes(null, null, null, createAllNotes(), null), createBaseCliOptions()
112124
.setGenerateAll(true).build());
113125

@@ -119,9 +131,12 @@ public void testGenerateOnlyMisc() throws Exception {
119131
assertFile("rssMlistMisc.txt", MainProcess.MLIST_FILENAME);
120132
}
121133

134+
/**
135+
* @noinspection JUnitTestMethodWithNoAssertions
136+
*/
122137
@Test
123138
public void testGenerateOnlyNewModule() throws Exception {
124-
final List<String> errors = MainProcess.run(
139+
final List<String> errors = MainProcess.runMainProcess(
125140
createNotes(null, null, null, null, createAllNotes()), createBaseCliOptions()
126141
.setGenerateAll(true).build());
127142

@@ -134,9 +149,12 @@ public void testGenerateOnlyNewModule() throws Exception {
134149
assertFile("githubPageNew.txt", MainProcess.GITHUB_FILENAME);
135150
}
136151

152+
/**
153+
* @noinspection JUnitTestMethodWithNoAssertions
154+
*/
137155
@Test
138156
public void testGenerateAll() throws Exception {
139-
final List<String> errors = MainProcess.run(
157+
final List<String> errors = MainProcess.runMainProcess(
140158
createNotes(
141159
Collections.singletonList(createReleaseNotesMessage("Title 1", "Author 1")),
142160
Collections.singletonList(createReleaseNotesMessage(2, "Title 2", "Author 2")),
@@ -154,9 +172,12 @@ public void testGenerateAll() throws Exception {
154172
assertFile("githubPageAll.txt", MainProcess.GITHUB_FILENAME);
155173
}
156174

175+
/**
176+
* @noinspection JUnitTestMethodWithNoAssertions
177+
*/
157178
@Test
158179
public void testGenerateOnlyXdoc() throws Exception {
159-
final List<String> errors = MainProcess.run(
180+
final List<String> errors = MainProcess.runMainProcess(
160181
createNotes(createAllNotes(), null, null, null, null), createBaseCliOptions()
161182
.setGenerateXdoc(true).build());
162183

@@ -169,9 +190,12 @@ public void testGenerateOnlyXdoc() throws Exception {
169190
assertFile(MainProcess.GITHUB_FILENAME);
170191
}
171192

193+
/**
194+
* @noinspection JUnitTestMethodWithNoAssertions
195+
*/
172196
@Test
173197
public void testGenerateOnlyTwitter() throws Exception {
174-
final List<String> errors = MainProcess.run(
198+
final List<String> errors = MainProcess.runMainProcess(
175199
createNotes(createAllNotes(), null, null, null, null), createBaseCliOptions()
176200
.setGenerateTw(true).build());
177201

@@ -184,9 +208,12 @@ public void testGenerateOnlyTwitter() throws Exception {
184208
assertFile(MainProcess.GITHUB_FILENAME);
185209
}
186210

211+
/**
212+
* @noinspection JUnitTestMethodWithNoAssertions
213+
*/
187214
@Test
188215
public void testGenerateOnlyRss() throws Exception {
189-
final List<String> errors = MainProcess.run(
216+
final List<String> errors = MainProcess.runMainProcess(
190217
createNotes(createAllNotes(), null, null, null, null), createBaseCliOptions()
191218
.setGenerateRss(true).build());
192219

@@ -199,9 +226,12 @@ public void testGenerateOnlyRss() throws Exception {
199226
assertFile(MainProcess.GITHUB_FILENAME);
200227
}
201228

229+
/**
230+
* @noinspection JUnitTestMethodWithNoAssertions
231+
*/
202232
@Test
203233
public void testGenerateOnlyMlist() throws Exception {
204-
final List<String> errors = MainProcess.run(
234+
final List<String> errors = MainProcess.runMainProcess(
205235
createNotes(createAllNotes(), null, null, null, null), createBaseCliOptions()
206236
.setGenerateMlist(true).build());
207237

@@ -214,6 +244,9 @@ public void testGenerateOnlyMlist() throws Exception {
214244
assertFile("rssMlistBreakingCompatibility.txt", MainProcess.MLIST_FILENAME);
215245
}
216246

247+
/**
248+
* @noinspection JUnitTestMethodWithNoAssertions
249+
*/
217250
@Test
218251
public void testGenerateOnlyGitHub() throws Exception {
219252
final List<String> errors = MainProcess.run(
@@ -235,7 +268,7 @@ public void testGenerateCustomTemplate() throws Exception {
235268
FileUtils.writeStringToFile(file, "hello world");
236269
final String template = file.getAbsolutePath();
237270

238-
final List<String> errors = MainProcess.run(
271+
final List<String> errors = MainProcess.runMainProcess(
239272
createNotes(createAllNotes(), createAllNotes(), createAllNotes(), createAllNotes(),
240273
createAllNotes()),
241274
createBaseCliOptions().setGenerateAll(true).setXdocTemplate(template)
@@ -328,15 +361,17 @@ private void assertFile(String expectedName, String actualName) throws IOExcepti
328361
.format(DateTimeFormatter.ofPattern("dd.MM.yyyy", Locale.US)),
329362
"XX.XX.XXXX");
330363

331-
Assert.assertEquals(expectedXdoc, actualXdoc);
364+
Assert.assertEquals("Actual filename does not match expected filename",
365+
expectedXdoc, actualXdoc);
332366
}
333367

334368
private void assertFile(String actualName) {
335-
Assert.assertFalse(new File(temporaryFolder.getRoot(), actualName).exists());
369+
Assert.assertFalse("File does not exist.",
370+
new File(temporaryFolder.getRoot(), actualName).exists());
336371
}
337372

338373
private static String getFileContents(File file) throws IOException {
339-
final StringBuilder result = new StringBuilder();
374+
final StringBuilder result = new StringBuilder(1024);
340375

341376
try (BufferedReader br = Files.newBufferedReader(file.toPath())) {
342377
do {

0 commit comments

Comments
 (0)