Skip to content

Commit 4976a08

Browse files
committed
check for AliceO2 namespace only at beginning of qualified type + formatting
1 parent 5cc3ca0 commit 4976a08

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

aliceO2/MemberNamesCheck.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,18 @@ void MemberNamesCheck::registerMatchers(MatchFinder *Finder) {
2424

2525
void MemberNamesCheck::check(const MatchFinder::MatchResult &Result) {
2626
const auto *MatchedDecl = Result.Nodes.getNodeAs<FieldDecl>("field_decl1");
27-
if(MatchedDecl)
28-
{
29-
// check that we are inside the AliceO2 namespace to exlude system stuff
30-
if ( MatchedDecl->getQualifiedNameAsString().find("AliceO2::") == std::string::npos )
31-
return;
27+
if(MatchedDecl) {
28+
// check that we are inside the AliceO2 namespace to exlude system stuff
29+
if ( MatchedDecl->getQualifiedNameAsString().find("AliceO2::") != 0 )
30+
return;
3231

33-
if (MatchedDecl->getName().startswith("m")){
34-
return;
35-
}
36-
diag(MatchedDecl->getLocation(), "field declaration %0 does not match naming rule", DiagnosticIDs::Error)
37-
<< MatchedDecl;
38-
// << FixItHint::CreateInsertion(MatchedDecl->getLocation(), "f");
32+
if (MatchedDecl->getName().startswith("m")){
33+
return;
3934
}
35+
diag(MatchedDecl->getLocation(), "field declaration %0 does not match naming rule", DiagnosticIDs::Error)
36+
<< MatchedDecl;
37+
// << FixItHint::CreateInsertion(MatchedDecl->getLocation(), "f");
38+
}
4039
}
4140

4241
} // namespace aliceO2

0 commit comments

Comments
 (0)