Skip to content

Commit 717e66b

Browse files
committed
Issue #614: Suppress all Idea Inspection violations
1 parent e532f8a commit 717e66b

File tree

8 files changed

+109
-28
lines changed

8 files changed

+109
-28
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
checkstyle.suppressions.file=config/suppressions.xml
21
checkstyle.header.file=https://raw.githubusercontent.com/checkstyle/checkstyle/master/config/java.header
3-
checkstyle.regexp.header.file=https://raw.githubusercontent.com/checkstyle/checkstyle/master/config/java_regexp.header
42
checkstyle.importcontrol.file=config/import-control.xml
53
checkstyle.importcontroltest.file=config/import-control-test.xml
4+
checkstyle.suppressions.file=config/suppressions.xml
65
checkstyle.suppressions-xpath.file=https://raw.githubusercontent.com/checkstyle/checkstyle/master/config/suppressions-xpath.xml
6+
checkstyle.regexp.header.file=https://raw.githubusercontent.com/checkstyle/checkstyle/master/config/java_regexp.header

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ private Main() {
4747
* Entry point.
4848
*
4949
* @param args command line arguments.
50+
* @noinspection UseOfSystemOutOrSystemErr, CallToSystemExit
5051
*/
5152
public static void main(String... args) {
5253
int errorCounter;
@@ -63,7 +64,8 @@ public static void main(String... args) {
6364
final Result notesBuilderResult = runGithubNotesBuilder(cliOptions);
6465
errorCounter = notesBuilderResult.getErrorMessages().size();
6566
if (errorCounter == 0) {
66-
publicationErrors = MainProcess.run(notesBuilderResult.getReleaseNotes(),
67+
publicationErrors = MainProcess.runMainProcess(
68+
notesBuilderResult.getReleaseNotes(),
6769
cliOptions);
6870
}
6971
}
@@ -122,6 +124,7 @@ private static Result runGithubNotesBuilder(CliOptions cliOptions)
122124
* Prints a list of elements in standard out.
123125
*
124126
* @param entities a list.
127+
* @noinspection UseOfSystemOutOrSystemErr
125128
*/
126129
private static void printListOf(List<String> entities) {
127130
System.out.println();

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

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

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.util.HashSet;
2828
import java.util.Optional;
2929
import java.util.Set;
30-
import java.util.stream.Collectors;
3130

3231
import org.eclipse.jgit.api.Git;
3332
import org.eclipse.jgit.api.errors.GitAPIException;
@@ -53,6 +52,7 @@
5352
*
5453
* @author Andrei Selkin
5554
*/
55+
@SuppressWarnings("deprecation")
5656
public final class NotesBuilder {
5757

5858
/** Array elements separator. */
@@ -85,6 +85,7 @@ private NotesBuilder() {
8585
* @return a map which represents release notes.
8686
* @throws IOException if an I/O error occurs.
8787
* @throws GitAPIException if an error occurs when accessing Git API.
88+
* @noinspection UseOfSystemOutOrSystemErr
8889
*/
8990
public static Result buildResult(String localRepoPath, String authToken, String remoteRepoPath,
9091
String startRef, String endRef) throws IOException, GitAPIException {
@@ -120,8 +121,7 @@ public static Result buildResult(String localRepoPath, String authToken, String
120121
if (issueLabel.isEmpty()) {
121122
final String error = String.format(MESSAGE_NO_LABEL,
122123
issueNo,
123-
Arrays.stream(Constants.ISSUE_LABELS)
124-
.collect(Collectors.joining(SEPARATOR)),
124+
String.join(SEPARATOR, Constants.ISSUE_LABELS),
125125
remoteRepoPath, issueNo);
126126
result.addError(error);
127127
}
@@ -272,7 +272,7 @@ private static Set<RevCommit> getCommitsForIssue(Set<RevCommit> commits, int iss
272272
*/
273273
private static String getAuthorsOf(Set<RevCommit> commits) {
274274
final Set<String> commitAuthors = findCommitAuthors(commits);
275-
return commitAuthors.stream().collect(Collectors.joining(SEPARATOR));
275+
return String.join(SEPARATOR, commitAuthors);
276276
}
277277

278278
/**

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/main/java/com/github/checkstyle/publishers/XdocPublisher.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public class XdocPublisher {
7272
* @param releaseNumber release number.
7373
* @param doPush whether to do push.
7474
* @param authToken auth token for Github.
75+
* @noinspection BooleanParameter
7576
*/
7677
public XdocPublisher(String postFilename, String localRepoPath, String releaseNumber,
7778
boolean doPush, String authToken) {

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(

0 commit comments

Comments
 (0)