File tree Expand file tree Collapse file tree
xdocs-examples/resources/com/puppycrawl/tools/checkstyle/checks/sizes/linelength Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -246,6 +246,40 @@ class Example5 {
246246 System.out.println("This line is long and exceeds the default limit of 80 characters.");
247247 }
248248}
249+ </code ></pre ></div ><hr class =" example-separator" />
250+ <p id =" Example6-config" >
251+ To prevent this check from flagging lines in text-blocks, with
252+ <a href =" https://github.com/checkstyle/checkstyle/issues/17707" >side effects</a >:
253+ </p >
254+ <div class =" wrapper" ><pre class =" prettyprint" ><code class =" language-xml" >
255+ < module name="Checker">
256+ < module name="LineLength">
257+ < property name="max" value="70"/>
258+ < /module>
259+ < module name="SuppressWithPlainTextCommentFilter">
260+ < property name="checkFormat" value="LineLength"/>
261+ < property name="offCommentFormat" value='^.*"""$'/>
262+ < property name="onCommentFormat" value='^\s*"""\s*(?:[,;]|.+)$'/>
263+ < /module>
264+ < /module>
265+ </code ></pre ></div >
266+ <p id =" Example6-code" >
267+ Example:
268+ </p >
269+ <div class =" wrapper" ><pre class =" prettyprint" ><code class =" language-java" >
270+ package com.puppycrawl.tools.checkstyle.checks.sizes.linelength;
271+
272+ public class Example6 {
273+ void testMethod() {
274+ String str1 = """
275+ This is a very really long string that exceeds the limit but no error....
276+ """;
277+ String str2 =
278+ """
279+ This is a very really long string that exceeds the limit but no error.....
280+ """;
281+ }
282+ }
249283</code ></pre ></div >
250284 </subsection >
251285
Original file line number Diff line number Diff line change 117117 <param name =" path"
118118 value =" resources/com/puppycrawl/tools/checkstyle/checks/sizes/linelength/Example5.java" />
119119 <param name =" type" value =" code" />
120+ </macro ><hr class =" example-separator" />
121+ <p id =" Example6-config" >
122+ To prevent this check from flagging lines in text-blocks, with
123+ <a href =" https://github.com/checkstyle/checkstyle/issues/17707" >side effects</a >:
124+ </p >
125+ <macro name =" example" >
126+ <param name =" path"
127+ value =" resources/com/puppycrawl/tools/checkstyle/checks/sizes/linelength/Example6.java" />
128+ <param name =" type" value =" config" />
129+ </macro >
130+ <p id =" Example6-code" >
131+ Example:
132+ </p >
133+ <macro name =" example" >
134+ <param name =" path"
135+ value =" resources/com/puppycrawl/tools/checkstyle/checks/sizes/linelength/Example6.java" />
136+ <param name =" type" value =" code" />
120137 </macro >
121138 </subsection >
122139
Original file line number Diff line number Diff line change 1+ /*xml
2+ <module name="Checker">
3+ <module name="LineLength">
4+ <property name="max" value="70"/>
5+ </module>
6+ <module name="SuppressWithPlainTextCommentFilter">
7+ <property name="checkFormat" value="LineLength"/>
8+ <property name="offCommentFormat" value='^.*"""$'/>
9+ <property name="onCommentFormat" value='^\s*"""\s*(?:[,;]|.+)$'/>
10+ </module>
11+ </module>
12+ */
13+ // xdoc section -- start
14+ package com .puppycrawl .tools .checkstyle .checks .sizes .linelength ;
15+
16+ public class Example6 {
17+ void testMethod () {
18+ String str1 = """
19+ This is a very really long string that exceeds the limit but no error....
20+ """ ;
21+ String str2 =
22+ """
23+ This is a very really long string that exceeds the limit but no error.....
24+ """ ;
25+ }
26+ }
27+ // xdoc section -- end
You can’t perform that action at this time.
0 commit comments