-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #15340: created InputFormatted file for section 2.3.1 whitespac…
…e characters
- Loading branch information
1 parent
5b2b330
commit 7a5837f
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
.../checkstyle/test/chapter2filebasic/rule231filetab/InputFormattedWhitespaceCharacters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.google.checkstyle.test.chapter2filebasic.rule231filetab; | ||
|
||
final class InputFormattedWhitespaceCharacters { | ||
// Long line ---------------------------------------------------------------- | ||
// Contains a tab -> <- // violation 'Line contains a tab character.' | ||
// Contains trailing whitespace -> | ||
|
||
/** | ||
* Some javadoc. | ||
* | ||
* @param badFormat1 bad format | ||
* @param badFormat2 bad format | ||
* @param badFormat3 bad format | ||
* @return hack | ||
* @throws Exception abc | ||
*/ | ||
int test1(int badFormat1, int badFormat2, final int badFormat3) throws Exception { | ||
return 0; | ||
} | ||
|
||
// A very, very long line that is OK because it matches the regexp "^.*is OK.*regexp.*$" | ||
// long line that has a tab -> <- and would be OK if tab counted as 1 char | ||
// violation above 'Line contains a tab character.' | ||
|
||
// tabs that count as one char because of their position -> <- -> <- | ||
// violation above 'Line contains a tab character.' | ||
|
||
/** some lines to test the column after tabs. */ | ||
void violateColumnAfterTabs() { | ||
// with tab-width 8 all statements below start at the same column, | ||
// with different combinations of ' ' and '\t' before the statement | ||
int tab0 = 1; | ||
int tab1 = 1; | ||
int tab2 = 1; | ||
int tab3 = 1; | ||
int tab4 = 1; | ||
int tab5 = 1; | ||
} | ||
} |