8000 Issue #15340: created InputFormatted file for section 3.3.2 No Line W… · checkstyle/checkstyle@8da6f47 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8da6f47

Browse files
Zopsssrdiachenko
authored andcommitted
Issue #15340: created InputFormatted file for section 3.3.2 No Line Wrapping
1 parent 7a5837f commit 8da6f47

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

config/checkstyle-non-main-files-suppressions.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
lines="1"/>
6868
<suppress id="lineLength"
6969
files="src[\\/]it[\\/]resources[\\/].*[\\/]InputNoLineWrapping\.java"/>
70+
<suppress id="lineLength"
71+
files="src[\\/]it[\\/]resources[\\/].*[\\/]InputFormattedNoLineWrapping\.java"/>
7072
<suppress id="lineLength"
7173
files="src[\\/]test[\\/]resources[\\/].*[\\/]InputLineLength.*\.java"/>
7274
<suppress id="lineLength"

src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrappingTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@ public void testBadLineWrap() throws Exception {
3535
verifyWithWholeConfig(getPath("InputNoLineWrapping.java"));
3636
}
3737

38+
@Test
39+
public void testBadLineWrapFormatted() throws Exception {
40+
verifyWithWholeConfig(getPath("InputFormattedNoLineWrapping.java"));
41+
}
42+
3843
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.google.checkstyle.test.chapter3filestructure.rule332nolinewrap;
2+
3+
// ok, long imports are allowed
4+
import com.google.checkstyle.test.chapter3filestructure.toolongpackagetotestcoveragegooglesjavastylerule.PackageStatementTest;
5+
6+
/** Some javadoc. */
7+
public class InputFormattedNoLineWrapping {
8+
9+
public void fooMethod() {
10+
//
11+
}
12+
13+
// Long line
14+
// --------------------------------------------------------------------------------------------------
15+
// violation above 'Line is longer than 100 characters (found 103).'
16+
17+
private int[] testing =
18+
new int[] {
19+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 12,
20+
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
21+
};
22+
23+
PackageStatementTest packageStatementTest = new PackageStatementTest();
24+
}

src/it/resources/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/InputNoLineWrapping.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
BigInteger.ONE;
55
import static java.math.BigInteger.ZERO; // ok
66

7-
import com.google.checkstyle.test.chapter3filestructure.toolongpackagetotestcoveragegooglesjavastylerule.PackageStatementTest; // ok, long imports are allowed
7+
// ok, long imports are allowed
8+
import com.google.checkstyle.test.chapter3filestructure.toolongpackagetotestcoveragegooglesjavastylerule.PackageStatementTest;
89
import com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck; // ok
910
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; // ok
1011
import java.util.concurrent.atomic // violation 'import statement should not be line-wrapped.'
@@ -29,4 +30,6 @@ public void fooMethod() {
2930
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 12,
3031
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
3132
};
33+
34+
PackageStatementTest packageStatementTest = new PackageStatementTest();
3235
}

0 commit comments

Comments
 (0)
0