File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -85,16 +85,27 @@ FORMATERROR=$(
85
85
# unqualified move()/forward() checks, i.e. make sure that std::move() and std::forward() are used instead of move() and forward()
86
86
preparedGrep " move\(.+\)" | grep -v " std::move" | grep -E " [^a-z]move"
87
87
preparedGrep " forward\(.+\)" | grep -v " std::forward" | grep -E " [^a-z]forward"
88
+ ) | grep -E -v -e " ^[a-zA-Z\./]*:[0-9]*:\s*\/(\/|\*)" -e " ^test/" || true
89
+ )
90
+
91
+ # Special error handling for `using namespace std;` exclusion, since said statement can be present in the test directory
92
+ # and its subdirectories, but is excluded in the above ruleset. In order to have consistent codestyle with regards to
93
+ # std namespace usage, test directory must also be covered.
94
+ FORMATSTDERROR=$(
95
+ (
88
96
# make sure `using namespace std` is not used in INCLUDE_DIRECTORIES
89
97
# shellcheck disable=SC2068,SC2068
90
98
grep -nIE -d skip " using namespace std;" ${NAMESPACE_STD_FREE_FILES[@]}
91
- ) | grep -E -v -e " ^[a-zA-Z\./]*:[0-9]*:\s*\/(\/|\*) " -e " ^test/ " | | true
99
+ ) || true
92
100
)
93
101
94
- if [[ " $FORMATERROR " != " " ]]
102
+ # Merge errors into single string
103
+ FORMATEDERRORS=" $FORMATERROR$FORMATSTDERROR "
104
+
105
+ if [[ " $FORMATEDERRORS " != " " ]]
95
106
then
96
107
echo " Coding style error:" | tee -a " $ERROR_LOG "
97
- echo " $FORMATERROR " | tee -a " $ERROR_LOG "
108
+ echo " $FORMATEDERRORS " | tee -a " $ERROR_LOG "
98
109
scripts/ci/post_style_errors_on_github.sh " $ERROR_LOG "
99
110
exit 1
100
111
fi
You can’t perform that action at this time.
0 commit comments