Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
c74f6d3c
Kaydet (Commit)
c74f6d3c
authored
Kas 16, 2017
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Warn when commit touches new files, but no suitable clang-format is found
Change-Id: Ifd254c30b8aecf6e7aec00bbfc8522a91bfa0909
üst
12130361
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
27 deletions
+31
-27
pre-commit
.git-hooks/pre-commit
+31
-27
No files found.
.git-hooks/pre-commit
Dosyayı görüntüle @
c74f6d3c
...
@@ -148,33 +148,30 @@ sub check_style($)
...
@@ -148,33 +148,30 @@ sub check_style($)
}
}
}
}
# Check if clang-format is installed.
# # Check if clang-format is installed.
if
(
!
-
x
$clang_format
)
# if (! -x $clang_format)
{
# {
# As a first step, don't do any checks in this case.
# my $platform = "linux64";
return
;
# my $download = "wget";
# if ($^O eq "cygwin")
my
$platform
=
"linux64"
;
# {
my
$download
=
"wget"
;
# $platform = "win.exe";
if
(
$^O
eq
"cygwin"
)
# }
{
# elsif ($^O eq "darwin")
$platform
=
"win.exe"
;
# {
}
# $platform = "mac";
elsif
(
$^O
eq
"darwin"
)
# $download = "curl -O";
{
# }
$platform
=
"mac"
;
#
$download
=
"curl -O"
;
# print("Error: clang-format is not found in $opt_lo or in your PATH.\n");
}
# print("To get a clang-format binary for your platform, please do:\n\n");
# print("mkdir -p $opt_lo\n");
print
(
"Error: clang-format is not found in $opt_lo or in your PATH.\n"
);
# print("cd $opt_lo\n");
print
(
"To get a clang-format binary for your platform, please do:\n\n"
);
# print("$download https://dev-www.libreoffice.org/bin/clang-format-$version-$platform\n");
print
(
"mkdir -p $opt_lo\n"
);
# print("cp clang-format-$version-$platform clang-format\n");
print
(
"cd $opt_lo\n"
);
# print("chmod +x clang-format\n");
print
(
"$download https://dev-www.libreoffice.org/bin/clang-format-$version-$platform\n"
);
# exit(1);
print
(
"cp clang-format-$version-$platform clang-format\n"
);
# }
print
(
"chmod +x clang-format\n"
);
exit
(
1
);
}
# Read the blacklist.
# Read the blacklist.
if
(
open
(
LINES
,
"solenv/clang-format/blacklist"
))
if
(
open
(
LINES
,
"solenv/clang-format/blacklist"
))
...
@@ -199,6 +196,13 @@ sub check_style($)
...
@@ -199,6 +196,13 @@ sub check_style($)
chomp
$filename
;
chomp
$filename
;
if
(
$filename
=~
/\.($src)$/
and
!
exists
(
$blacklist_names
{
$filename
}))
if
(
$filename
=~
/\.($src)$/
and
!
exists
(
$blacklist_names
{
$filename
}))
{
{
if
(
!
-
x
$clang_format
)
{
print
(
"\nWARNING: Commit touches new (non-blacklisted) files, but no clang-format"
.
" ${version}\n"
);
print
(
" found (via CLANG_FORMAT or PATH env vars, or in ${opt_lo}).\n\n"
);
return
;
}
if
(
system
(
"$clang_format $filename | git --no-pager diff --no-index --exit-code $filename -"
)
!=
0
)
if
(
system
(
"$clang_format $filename | git --no-pager diff --no-index --exit-code $filename -"
)
!=
0
)
{
{
push
@bad_names
,
$filename
;
push
@bad_names
,
$filename
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment