diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-04-27 11:31:04 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-04-27 17:28:17 +0200 |
commit | f3665d2a42b39814764f3eb9e20498b8a4be1d00 (patch) | |
tree | cdda46b9e259e4247074f783e98c87082089192b /.git-hooks | |
parent | 707db60df761a98cfdbd771fdc85979084be0b33 (diff) |
Check UI interface domains in the git pre-commit hook
This will prevent bugs like tdf#141902 to happen
Change-Id: If81164c704ec17d3fee044aaa0ec9c16d474009e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114705
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to '.git-hooks')
-rwxr-xr-x | .git-hooks/pre-commit | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit index 1f2e9307de01..578159e7c6e9 100755 --- a/.git-hooks/pre-commit +++ b/.git-hooks/pre-commit @@ -18,6 +18,11 @@ sub check_whitespaces($) my $src_limited = "c|cpp|cxx|h|hrc|hxx|idl|inl|java|swift|map|MK|pmk|pl|pm|sdi|sh|src|tab|ui|xcu|xml|xsl|py"; my $src_full = "c|cpp|cxx|h|hrc|hxx|idl|inl|java|swift|map|mk|MK|pmk|pl|pm|sdi|sh|src|tab|ui|xcu|xml|xsl|py"; + my %modules = (basctl=>'basctl', chart2=>'chart', cui=>'cui', dbaccess=>'dba', desktop=>'dkt', editeng=>'editeng', + extensions=>'pcr', filter=>'flt', formula=>'"for"', fpicker=>'fps', framework=>'fwk', reportdesign=>'rpt', + sc=>'sc', sd=>'sd', sfx2=>'sfx', starmath=>'sm', svtools=>'svt', svx=>'svx', sw=>'sw', uui=>'uui', + vcl=>'vcl', writerperfect=>'wpt', xmlsecurity=>'xsc'); + my $found_bad = 0; my $filename; my $reported_filename = ""; @@ -137,6 +142,15 @@ sub check_whitespaces($) { bad_line(".ui file without translation domain", $_, "ui"); } + if (/<interface domain=/) + { + foreach my $key (keys %modules) { + if ((rindex($filename, $key, 0) == 0) and not (/$modules{$key}/)) + { + bad_line("interface domain should be '$modules{$key}'", $_, "ui"); + } + } + } } } if ( $found_bad) |