forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#13782: Fix false negative for annotation indentation
- Loading branch information
1 parent
a5d0468
commit c916d7a
Showing
4 changed files
with
178 additions
and
9 deletions.
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
41 changes: 41 additions & 0 deletions
41
...checkstyle/checks/indentation/indentation/InputIndentationAnnotationMultiLineCorrect.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,41 @@ | ||
package com.puppycrawl.tools.checkstyle.checks.indentation.indentation;//indent:0 exp:0 | ||
//indent:0 exp:0 | ||
/** //indent:0 exp:0 | ||
* This test-input is intended to be checked using following configuration: //indent:1 exp:1 | ||
* //indent:1 exp:1 | ||
* arrayInitIndent = 2 //indent:1 exp:1 | ||
* basicOffset = 2 //indent:1 exp:1 | ||
* braceAdjustment = 2 //indent:1 exp:1 | ||
* caseIndent = 4 //indent:1 exp:1 | ||
* lineWrappingIndentation = 4 //indent:1 exp:1 | ||
* throwsIndent = 4 //indent:1 exp:1 | ||
*/ //indent:1 exp:1 | ||
//indent:0 exp:0 | ||
@X//indent:0 exp:0 | ||
public @Z//indent:0 exp:0 | ||
@W class InputIndentationAnnotationMultiLineCorrect//indent:4 exp:4 | ||
implements MyInterfaceTwo {//indent:4 exp:4 | ||
//indent:0 exp:0 | ||
//indent:0 exp:0 | ||
}//indent:0 exp:0 | ||
@M class AnotherClassTwo {}//indent:0 exp:0 | ||
//indent:0 exp:0 | ||
@interface X {}//indent:0 exp:0 | ||
@interface Y {}//indent:0 exp:0 | ||
@interface Z {}//indent:0 exp:0 | ||
@interface W {}//indent:0 exp:0 | ||
@interface M {}//indent:0 exp:0 | ||
@interface K {}//indent:0 exp:0 | ||
@interface P {}//indent:0 exp:0 | ||
@interface Q {}//indent:0 exp:0 | ||
interface MyInterfaceTwo {}//indent:0 exp:0 | ||
//indent:0 exp:0 | ||
@X @Y//indent:0 exp:0 | ||
final @P @K//indent:0 exp:0 | ||
@M class MyClassTwoTwo//indent:4 exp:4 | ||
implements MyInterfaceTwo {}//indent:4 exp:4 | ||
//indent:0 exp:0 | ||
@X @Y//indent:0 exp:0 | ||
abstract @P//indent:0 exp:0 | ||
@M @K class HisClassTwo//indent:4 exp:4 | ||
implements MyInterfaceTwo {}//indent:4 exp:4 |
41 changes: 41 additions & 0 deletions
41
...eckstyle/checks/indentation/indentation/InputIndentationAnnotationMultiLineIncorrect.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,41 @@ | ||
package com.puppycrawl.tools.checkstyle.checks.indentation.indentation;//indent:0 exp:0 | ||
//indent:0 exp:0 | ||
/** //indent:0 exp:0 | ||
* This test-input is intended to be checked using following configuration: //indent:1 exp:1 | ||
* //indent:1 exp:1 | ||
* arrayInitIndent = 2 //indent:1 exp:1 | ||
* basicOffset = 2 //indent:1 exp:1 | ||
* braceAdjustment = 2 //indent:1 exp:1 | ||
* caseIndent = 4 //indent:1 exp:1 | ||
* lineWrappingIndentation = 4 //indent:1 exp:1 | ||
* throwsIndent = 4 //indent:1 exp:1 | ||
*/ //indent:1 exp:1 | ||
//indent:0 exp:0 | ||
@A//indent:0 exp:0 | ||
public @G//indent:0 exp:0 | ||
@N class InputIndentationAnnotationMultiLineIncorrect//indent:0 exp:4 warn | ||
implements MyInterface {//indent:4 exp:4 | ||
//indent:0 exp:0 | ||
//indent:0 exp:0 | ||
}//indent:0 exp:0 | ||
@T class AnotherClass {}//indent:0 exp:0 | ||
//indent:0 exp:0 | ||
@interface A {}//indent:0 exp:0 | ||
@interface B {}//indent:0 exp:0 | ||
@interface G {}//indent:0 exp:0 | ||
@interface N {}//indent:0 exp:0 | ||
@interface T {}//indent:0 exp:0 | ||
@interface C {}//indent:0 exp:0 | ||
@interface D {}//indent:0 exp:0 | ||
@interface E {}//indent:0 exp:0 | ||
interface MyInterface {}//indent:0 exp:0 | ||
//indent:0 exp:0 | ||
@A @B//indent:0 exp:0 | ||
final @C @D//indent:0 exp:0 | ||
@E class MyClass//indent:0 exp:4 warn | ||
implements MyInterface {}//indent:4 exp:4 | ||
//indent:0 exp:0 | ||
@A @B//indent:0 exp:0 | ||
abstract @C//indent:0 exp:0 | ||
@E @D class HisClass//indent:0 exp:4 warn | ||
implements MyInterface {}//indent:4 exp:4 |