Skip to content

Commit 51b5e00

Browse files
committed
2021-01-23 Version 1.1.0: Updated AndroidViewFieldNameCheck
1 parent d4bf78f commit 51b5e00

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group 'com.smlnskgmail.jaman.checkstyle'
8-
version '1.0.0'
8+
version '1.1.0'
99

1010
checkstyle {
1111
toolVersion '8.38'

src/main/java/com/smlnskgmail/jaman/checkstyle/checks/AndroidViewFieldNameCheck.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,31 @@ public void visitToken(DetailAST ast) {
2424
log(ast);
2525
}
2626
break;
27+
case "ImageButton":
28+
if (!ast.findFirstToken(TokenTypes.IDENT).getText().startsWith("ib")) {
29+
log(ast);
30+
}
31+
break;
2732
case "EditText":
2833
if (!ast.findFirstToken(TokenTypes.IDENT).getText().startsWith("et")) {
2934
log(ast);
3035
}
3136
break;
37+
case "Button":
38+
if (!ast.findFirstToken(TokenTypes.IDENT).getText().startsWith("btn")) {
39+
log(ast);
40+
}
41+
break;
42+
case "RecyclerView":
43+
if (!ast.findFirstToken(TokenTypes.IDENT).getText().startsWith("rv")) {
44+
log(ast);
45+
}
46+
break;
47+
case "AdaptiveRecyclerView":
48+
if (!ast.findFirstToken(TokenTypes.IDENT).getText().startsWith("arv")) {
49+
log(ast);
50+
}
51+
break;
3252
}
3353
}
3454
}

0 commit comments

Comments
 (0)