summaryrefslogtreecommitdiff
path: root/.git-hooks/pre-commit
AgeCommit message (Collapse)AuthorFilesLines
2021-04-28git pre-commit hook: fix typoXisco Fauli1-1/+1
This code was copy&paste from bin/ui-checkdomain.sh in f3665d2a42b39814764f3eb9e20498b8a4be1d00 <Check UI interface domains in the git pre-commit hook> and it was already wrong there. Kudos to Julien Nabet for flagging it Change-Id: Id2b16cf76f6e4f983dc59673b67ce369a84cffd5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114762 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-04-27Check UI interface domains in the git pre-commit hookXisco Fauli1-0/+14
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>
2021-01-15replace stock button imagesCaolán McNamara1-0/+8
Change-Id: I9be83856c0dd15552a042f009464c279bf239848 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109199 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-15remove newly unused use-stock supportCaolán McNamara1-0/+4
Change-Id: I235cf19e703be0a7ca9fdeeda0662c8e0ec54b63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109198 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-14drop newly added deprecated GtkAlignment instanceCaolán McNamara1-0/+4
Change-Id: Iad8d15ffc89b48aca698553329cda643dd0b4406 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109260 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-22replace margin-left with margin-start and margin-right with margin-endCaolán McNamara1-3/+11
Change-Id: Iee3cc8c22b393ca420d0ed68673c61fe7ef240ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108113 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-10-22set all .ui min require version of gtk to 3.20Caolán McNamara1-2/+2
and update the version mentioned in our min req in the readme.xrm follow up to commit 0c9ccc7dbf6deb4d012e0d1e6eb934e54e0f19bc Author: Caolán McNamara <caolanm@redhat.com> Date: Fri Oct 2 21:21:45 2020 +0100 raise min version of gtk to 3.20.0 Change-Id: Ibae55c97e1ee577f4b7435d124cda6a21005ad0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104692 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-10-09tdf#134286: fix pre-commit hook to make hooks.allownonascii workShiro Kawai1-0/+1
Even if hooks.allownonascii is set to true, the current code compares "true\n" vs "true" and always rejects committing. Change-Id: I75494f149db2537ad54230dd684f5dac9b43c8b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97213 Tested-by: Takeshi Abe <tabe@fixedpoint.jp> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2020-09-09git pre-commit hook: check OOXMLIMPORT and OOXMLEXPORT...Xisco Fauli1-0/+8
... are used in the right place Change-Id: I49bfe2f03e519138ae78a7462afe98932a335365 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102264 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-08-12git pre-commit hook: check min gtk3 versionXisco Fauli1-0/+4
See tdf#135442 for motivation Change-Id: I6db67b7a39edeb6dd9d9d82fbaa9cb93362e09e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100588 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-07-10Fixup pre-commit hook to work with worktreesThorsten Behrens1-1/+7
For git worktree setups, the hooks sit with the original repo (usually the initial clone). Worktrees with older version checkouts then miss the blacklist->excludelist rename, and consequently fail. Change-Id: I5f60fabc7d5856c74d93c4ada54f57574e0fd1a9
2020-07-10replace usage of blacklist with denylistThorsten Behrens1-3/+3
.. and a few cases of instead doing blacklist->excludelist where that made more sense. Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 [API CHANGE] officecfg::Office::Canvas::DeviceBlacklist -> DeviceDenylist [API CHANGE] officecfg::Office::Canvas::BlacklistCurrentDevice -> DenylistCurrentDevice [API CHANGE] officecfg::Office::Common::Misc::OpenCLBlackList -> OpenCLDenyList Change-Id: Ia35e25496bf0cc0692d5de4cb66bfc232d3a869e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98180 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-11-22git hooks: Tell what to do in another problematic submodules case.Jan Holesovsky1-0/+6
Change-Id: I6247df16c021c13c97471cae16d3a1c0f3ddc691
2018-11-22git hooks: Check that you are not committing to submodules by accident.Jan Holesovsky1-0/+54
And also for a dangerous setting in the configuration that hides the changes from you. Change-Id: I99bad8024baf7048696d9602e857c253c20cb5c2 Reviewed-on: https://gerrit.libreoffice.org/63389 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2018-10-03Add Python files to pre-commit hook checksThorsten Behrens1-2/+2
Change-Id: Ie5a631abe25a25bab9e74b353994f0788fe3dd06 Reviewed-on: https://gerrit.libreoffice.org/61279 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-02-09clang-format: improve error message when CI failsMiklos Vajna1-0/+2
Don't just tell the problem but hint how to fix it. Change-Id: I9d079ee7d4ed61266e22a3fa21efe10366724645 Reviewed-on: https://gerrit.libreoffice.org/49471 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-15git pre-commit hook: catch copy&pasted author identityMiklos Vajna1-0/+14
git log --author="Your" confirms that this happens in practice. Change-Id: I48633bc9154ebc66fc022938831057bdc3ff76b3 Reviewed-on: https://gerrit.libreoffice.org/47892 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-12-15clang-format: restore lost warning on touching formatted file without checkMiklos Vajna1-1/+1
Consistently only assign something to $clang_format if it's a good version, and also consistently return undef if we found no good version. Change-Id: Iadbbb56a5c15dfaeec5c80e3cc8fcc78b787c04b Reviewed-on: https://gerrit.libreoffice.org/46489 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-12-13clang-format: ignore not staged hunksMiklos Vajna1-2/+1
09:28 <@sberg> vmiklos, I think I ran into a scenario last night where I had both `git add`-ed and non-added changes in a non-blacklisted file, and the non-added changes violated clang-format (and the added ones did not), and the commit hook complained So make sure we validate the index version, not the filesystem one. (And modify a formatted file to trigger CI validation of the hook change itself.) Change-Id: I6431b35ac50dd03741104b5709c5195d6ff28632 Reviewed-on: https://gerrit.libreoffice.org/46368 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-21git-hooks: fix pre-commit in submodulesMiklos Vajna1-1/+9
translations.git failed with "Can't locate ClangFormat.pm in @INC (you may need to install the ClangFormat module)". Change-Id: Ibbe051c1cb4c1200da58821589b8271434b1f9a6 Reviewed-on: https://gerrit.libreoffice.org/45020 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-20clang-format: enforce coding style via JenkinsMiklos Vajna1-53/+10
- factor out common code to a shared module, and quote path to the clang-format binary, just in case. - add a new check-last-commit script that is the CI equivalent of the exiting git pre-commit hook, but this one handles lack of clang-format as an error, not as a warning. - $LODE_HOME/opt/bin is supposed to be in PATH already, so not mentioning LODE_HOME in ClangFormat::find() explicitly. - if both COMPILER_PLUGINS and LODE_HOME is set, invoke solenv/clang-format/check-last-commit as part of 'make check' To test these changes as part of CI, fix a single style violation in an already committed, non-blacklisted file. This depends on the lode.git commit 496123bcae28e06c6d6aeda39a5afd1e1fb1fd98 (utils_Linux: install clang-format in the Jenkins case, 2017-11-16), otherwise erroring out on a not installed clang-format as part of the build would be a problem. Change-Id: Ib3110826194ff78a7f1bed1c3796147e92ccb3ba Reviewed-on: https://gerrit.libreoffice.org/44939 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-16git-hooks: mention download link for clang-format when warning about itMiklos Vajna1-25/+22
Change-Id: I99f2154bb3d15fe4a99c1d27ca20756e1fb31cec Reviewed-on: https://gerrit.libreoffice.org/44810 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-16Warn when commit touches new files, but no suitable clang-format is foundStephan Bergmann1-27/+31
Change-Id: Ifd254c30b8aecf6e7aec00bbfc8522a91bfa0909
2017-11-13First look for clang-format in CLANG_FORMT env varStephan Bergmann1-8/+12
Change-Id: I5de5c6f3e8be1d40c03cbddb9d2f4414b9a5791b
2017-11-13clang-format: standardize on 5.0.0Miklos Vajna1-13/+25
Restrict the git hook further to only enforce style in case the found clang-format binary's version matches to avoid output differences with different clang-format version. While at it, move the blacklist reading after the version check to speed up committing a bit when no local enforcement happens. Also add a simple script to list formatted files, since the blacklist is large enough that doing it naively from the shell is too slow. Change-Id: I0bc05961d262cc6bc91c6efdd1b91994ecfc6940 Reviewed-on: https://gerrit.libreoffice.org/44662 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-03Enforce coding style with clang-format for new codeMiklos Vajna1-0/+113
- The actual blacklist has to be generated with solenv/clang-format/generate-style-blacklist.sh in a separate commit. - .clang-format is from <https://lists.freedesktop.org/archives/libreoffice/2014-August/062802.html>, except: - the commented out lines are removed - Standard is Cpp11 instead of Cpp03 - explicitly avoid sorting includes (requested during ESC meeting 2017-10-11) - no indentation inside namespaces (lots of existing code in sc wants this) - The git hooks prints a diff when the style is violated, along with a command to fix up the violation automatically. It also enforces style only in new files and ignores all files listed in the blacklist. - To avoid introducing one more hard-to-setup build dependency for new developers, help them two ways: - if clang-format is not installed, provide pre-built binaries for Linux/Windows/macOS - download/install of these binaries are printed as cmdline instructions, similar to how we have our own 'make' on Windows - As per ESC call 2017-11-02, currently don't do any checks if clang-format is not installed (as a first step). Change-Id: Iaa139c396337e8734aa1853305d808438260c41a Reviewed-on: https://gerrit.libreoffice.org/43736 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-10-30git-hooks: don't complain about large .ui filesMichael Stahl1-0/+8
Looks legit. Change-Id: I73562d0a8d863868ae717cee97b6497a93df4ee4
2017-09-20pre-commit-hook: Also check xsl files for whitespace and tabsSamuel Mehrbrodt1-2/+2
Change-Id: Ibc1520735ab20787496564e8561a6bb5920a5538 Reviewed-on: https://gerrit.libreoffice.org/42280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-09-11insist in a domain in .ui filesCaolán McNamara1-4/+7
and just check .ui files for those .ui-specific patterns Change-Id: If7b9c8779f7592db5b22ab96058dd85666ca9bdf Reviewed-on: https://gerrit.libreoffice.org/42160 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-11disallow .ui translatable entries without context at checkinCaolán McNamara1-0/+5
Change-Id: Iece6ae3c4eabad4cd113f469495d2c42833a7b92 Reviewed-on: https://gerrit.libreoffice.org/42157 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-24git pre-commit hook: Also check swift filesSamuel Mehrbrodt1-2/+2
Change-Id: I60c7ccd06b104c6a6ae5e7985fe8c3215f7e97d4 Reviewed-on: https://gerrit.libreoffice.org/35624 Reviewed-by: jan iversen <jani@libreoffice.org> Tested-by: jan iversen <jani@libreoffice.org>
2016-12-08tdf#102784 - Enhance git pre-commit hookMarina Latini1-0/+4
This pre-commit hook prevents the commit of ui files with tooltip_markup property Change-Id: I70d6f90fc36e782c290f35f0cc9415b9fa96495b Signed-off-by: Marina Latini <marina@studiostorti.com> Reviewed-on: https://gerrit.libreoffice.org/31735 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Muhammet Kara <muhammet.kara@pardus.org.tr> Tested-by: Muhammet Kara <muhammet.kara@pardus.org.tr> Reviewed-by: jan iversen <jani@documentfoundation.org>
2015-06-13Catch funny line-ends in pre-commit hook.Thorsten Behrens1-0/+4
Change-Id: I38836a9b3c9fb8ab7b71e157bba8a803eb4d3905
2014-05-16git pre-commit hook: block large filesMiklos Vajna1-0/+14
Change-Id: Id27cfa805fc7cd0f4f6cc3d8bb770aa7abd536e1
2012-10-26add hook to block use of markup in .ui filesCaolán McNamara1-2/+6
Change-Id: Ia7eed5e9e1f8fba9876730e909461dabc167deb9
2012-10-16submodules migrationNorbert Thiebaud1-0/+135
Change-Id: Ib3e472a4b1abf880f695be7a6667393d6a82f10d