@@ -13,18 +13,22 @@ grep "endl" --recursive library_checker_aizu_tests/ && exit 1
1313echo " check template<class T> over template<typename T>:"
1414grep --extended-regexp " template\s?<typename" --recursive ../library/ && exit 1
1515
16+ # comment lines are excluded from the macro checks below: doc
17+ # comments spell out the macros to match the expanded main branch
18+ comment_line=" ^[^:]*:[[:space:]]*//"
19+
1620echo " check ll instead of long long or int64_t"
17- grep " long long" --recursive ../library/ && exit 1
18- grep " int64_t" --recursive ../library/** /* .hpp | grep " uint64_t" --invert-match && exit 1
21+ grep " long long" --recursive ../library/ | grep --invert-match --extended-regexp " $comment_line " && exit 1
22+ grep " int64_t" --recursive ../library/** /* .hpp | grep " uint64_t" --invert-match | grep --invert-match --extended-regexp " $comment_line " && exit 1
1923
2024echo " check pii instead of pair<int, int>"
21- grep " pair<int, int>" --recursive ../library/** /* .hpp && exit 1
25+ grep " pair<int, int>" --recursive ../library/** /* .hpp | grep --invert-match --extended-regexp " $comment_line " && exit 1
2226
2327echo " check sz instead of ssize"
24- grep " ssize" --recursive ../library/ && exit 1
28+ grep " ssize" --recursive ../library/ | grep --invert-match --extended-regexp " $comment_line " && exit 1
2529
2630echo " check vi instead of vector<int>"
27- grep " vector<int>" --recursive ../library/** /* .hpp && exit 1
31+ grep " vector<int>" --recursive ../library/** /* .hpp | grep --invert-match --extended-regexp " $comment_line " && exit 1
2832
2933echo " check begin(arr) instead of arr.begin(), similarly for end, rbegin, rend, empty, size:"
3034grep --recursive ../library/ library_checker_aizu_tests/ --fixed-strings --regexp=" .begin()" --regexp=" .rbegin()" --regexp=" .end()" --regexp=" .rend()" --regexp=" .empty()" --regexp=" .size()" && exit 1
0 commit comments