Skip to content

Commit 3c6ed6d

Browse files
Merge branch 'master' into issue1264
2 parents fc52c25 + e1a7255 commit 3c6ed6d

File tree

21 files changed

+160
-167
lines changed

21 files changed

+160
-167
lines changed

.github/workflows/mvn.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [windows-2022, ubuntu-22.04, macos-12]
16-
java: [11, 20]
16+
java: [11, 21]
1717
steps:
1818
- uses: actions/checkout@v4
1919
- uses: actions/setup-java@v4

INSTALL.txt

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Just add this plugin to your `pom.xml`:
3232
<plugin>
3333
<groupId>com.qulice</groupId>
3434
<artifactId>qulice-maven-plugin</artifactId>
35-
<version>0.22.2</version>
35+
<version>0.23.0</version>
3636
<configuration>
3737
<license>file:${basedir}/LICENSE.txt</license>
3838
</configuration>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
230230
<plugin>
231231
<groupId>com.qulice</groupId>
232232
<artifactId>qulice-maven-plugin</artifactId>
233-
<version>0.22.2</version>
233+
<version>0.23.0</version>
234234
</plugin>
235235
</plugins>
236236
</build>

qulice-checkstyle/src/main/java/com/qulice/checkstyle/DiamondOperatorCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ private static DetailAST secondChild(final DetailAST node) {
189189
* @return True if node contains angle brackets only
190190
*/
191191
private static boolean isDiamondOperatorUsed(final DetailAST node) {
192-
return node.getChildCount() == 2
192+
return node != null && node.getChildCount() == 2
193193
&& node.getFirstChild().getType() == TokenTypes.GENERIC_START
194194
&& node.getLastChild().getType() == TokenTypes.GENERIC_END;
195195
}

qulice-checkstyle/src/main/java/com/qulice/checkstyle/MultilineJavadocTagsCheck.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public int[] getDefaultTokens() {
6767
return new int[] {
6868
TokenTypes.METHOD_DEF,
6969
TokenTypes.CTOR_DEF,
70+
TokenTypes.PACKAGE_DEF,
7071
};
7172
}
7273

qulice-checkstyle/src/test/java/com/qulice/checkstyle/CheckstyleValidatorTest.java

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -445,23 +445,44 @@ void allowsOnlyProperlyOrderedAtClauses() throws Exception {
445445
* @throws Exception If something wrong happens inside
446446
*/
447447
@Test
448-
@Disabled
449448
void passesWindowsEndsOfLineWithoutException() throws Exception {
450-
this.common.validate("WindowsEol.java", false, "LICENSE found:");
449+
final String file = "WindowsEol.java";
450+
final Collection<Violation> results = this.common.runValidation(file, false);
451+
MatcherAssert.assertThat(
452+
"violation should be reported correctly",
453+
results,
454+
Matchers.contains(
455+
new ViolationMatcher(
456+
"Line does not match expected header line of ' */'.",
457+
file,
458+
"3",
459+
"HeaderCheck"
460+
)
461+
)
462+
);
451463
}
452464

453465
/**
454466
* Fail validation with Windows-style formatting of the license and
455467
* Linux-style formatting of the sources.
456468
* @throws Exception If something wrong happens inside
457-
* @todo #61:30min This test and passesWindowsEndsOfLineWithoutException
458-
* should be refactored to gather log4j logs and validate that they work
459-
* correctly. (see changes done in #61)
460469
*/
461470
@Test
462-
@Disabled
463471
void testWindowsEndsOfLineWithLinuxSources() throws Exception {
464-
this.common.runValidation("WindowsEolLinux.java", false);
472+
final String file = "WindowsEolLinux.java";
473+
final Collection<Violation> results = this.common.runValidation(file, false);
474+
MatcherAssert.assertThat(
475+
"violation should be reported correctly",
476+
results,
477+
Matchers.contains(
478+
new ViolationMatcher(
479+
"Line does not match expected header line of ' * Hello.'.",
480+
file,
481+
"2",
482+
"HeaderCheck"
483+
)
484+
)
485+
);
465486
}
466487

467488
/**

qulice-checkstyle/src/test/resources/com/qulice/checkstyle/ChecksTest/MultilineJavadocTagsCheck/Invalid.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @deprecated text Some text, which description
3+
* takes a few lines (incorrect formatting)
4+
* takes a few lines (incorrect formatting)
5+
*/
6+
package does.not.matter;
7+
8+
19
/*
210
* This is not a real Java class. It won't be compiled ever. It is used
311
* only as a text resource in integration.ChecksIT.

qulice-checkstyle/src/test/resources/com/qulice/checkstyle/ChecksTest/MultilineJavadocTagsCheck/Valid.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
/*
22
* LICENSE.
33
*/
4+
/**
5+
* Some text.
6+
* sadsdada
7+
* @param text Some text, which description
8+
* takes a few lines
9+
*/
410
package foo;
511

612
import java.util.List;
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
10:Should contain one indentation space
2-
12:Should contain one indentation space
3-
19:Should contain one indentation space
1+
3:Should contain one indentation space
2+
4:Should contain one indentation space
3+
18:Should contain one indentation space
44
20:Should contain one indentation space
5-
23:Should contain one indentation space
6-
25:Should contain one indentation space
7-
29:Should contain one indentation space
8-
39:Should contain one indentation space
9-
41:Should contain one indentation space
10-
48:Should contain one indentation space
5+
27:Should contain one indentation space
6+
28:Should contain one indentation space
7+
31:Should contain one indentation space
8+
33:Should contain one indentation space
9+
37:Should contain one indentation space
10+
47:Should contain one indentation space
1111
49:Should contain one indentation space
12-
52:Should contain one indentation space
13-
54:Should contain one indentation space
14-
58:Should contain one indentation space
12+
56:Should contain one indentation space
13+
57:Should contain one indentation space
14+
60:Should contain one indentation space
15+
62:Should contain one indentation space
16+
66:Should contain one indentation space

0 commit comments

Comments
 (0)