Kaydet (Commit) e61a1b8d authored tarafından Stephan Bergmann's avatar Stephan Bergmann

First look for clang-format in CLANG_FORMT env var

Change-Id: I5de5c6f3e8be1d40c03cbddb9d2f4414b9a5791b
üst 0c5eda98
......@@ -127,19 +127,23 @@ sub check_style($)
my @bad_names = ();
my %blacklist_names = ();
# Use clang-format from PATH, unless it's available in our dedicated
# Use clang-format from CLANG_FORMAT, or from PATH unless it's available in our dedicated
# directory.
my $opt_lo = "/opt/lo/bin";
my $clang_format = "$opt_lo/clang-format";
my $version = "5.0.0";
if (!is_matching_clang_format_version($clang_format, $version))
my $opt_lo = "/opt/lo/bin";
my $clang_format = $ENV{CLANG_FORMAT};
if (!(defined($clang_format) && is_matching_clang_format_version($clang_format, $version)))
{
foreach my $dir (split /:/, $ENV{PATH})
$clang_format = "$opt_lo/clang-format";
if (!is_matching_clang_format_version($clang_format, $version))
{
$clang_format = "$dir/clang-format";
if (is_matching_clang_format_version($clang_format, $version))
foreach my $dir (split /:/, $ENV{PATH})
{
last;
$clang_format = "$dir/clang-format";
if (is_matching_clang_format_version($clang_format, $version))
{
last;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment