Skip to content

Commit 5253750

Browse files
committed
added ignoreClass for NameCheckBase
1 parent 9ce1a07 commit 5253750

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

checkstyle/ChecksInfo.hx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class ChecksInfo {
1313
var checksClasses = CompileTime.getAllClasses(Check);
1414

1515
for (cl in checksClasses) {
16+
if (ignoreClass(cl)) continue;
1617
var name = getCheckNameFromClass(cl);
1718
var desc = getCheckDescription(cl);
1819
name2info[name] = {
@@ -23,6 +24,11 @@ class ChecksInfo {
2324
}
2425
}
2526

27+
static function ignoreClass(cl:Class<Check>) {
28+
var meta = haxe.rtti.Meta.getType(cl);
29+
return (meta.ignore != null);
30+
}
31+
2632
static function getCheckNameFromClass(cl:Class<Check>) {
2733
var meta = haxe.rtti.Meta.getType(cl);
2834
if (meta.name == null) throw '${Type.getClassName(cl)} have no @name meta.';
@@ -53,4 +59,4 @@ typedef CheckInfo = {
5359
var name:String;
5460
var description:String;
5561
var clazz:Class<Check>;
56-
}
62+
}

checkstyle/checks/NameCheckBase.hx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import checkstyle.LintMessage.SeverityLevel;
44
import haxeparser.Data;
55
import haxe.macro.Expr;
66

7-
// TODO find a better way to make ChecksInfo ignore this class
8-
@name("")
9-
@desc("")
7+
@ignore("Base class for name checks")
108
class NameCheckBase extends Check {
119

1210
public var severity:String;

run.n

125 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)