Skip to content

Commit

Permalink
check-style: Discard prefixes when checking clang version
Browse files Browse the repository at this point in the history
Ignore prefixes before the "clang-format version ..." string. Some
builds may contain the distributor name there, so removing the match
anchor allows to paper over those prefixes.
  • Loading branch information
aperezdc committed Apr 23, 2021
1 parent 0d44cb4 commit e21e329
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/check-style
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fi
declare -r clang_format_min_version=11

clang_format_version=$("${clang_format}" --version)
if [[ ${clang_format_version} =~ ^clang-format[[:space:]]+version[[:space:]]+([[:digit:]]+)\. ]] ; then
if [[ ${clang_format_version} =~ clang-format[[:space:]]+version[[:space:]]+([[:digit:]]+)\. ]] ; then
clang_format_version=${BASH_REMATCH[1]}
if [[ ${clang_format_version} -lt ${clang_format_min_version} ]] ; then
echo "$0: clang-format ${clang_format_min_version}+ is needed, ${clang_format_version} detected" 1>&2
Expand Down

0 comments on commit e21e329

Please sign in to comment.