office-gobmx/.git-hooks
Miklos Vajna 98f5f4d39c Enforce coding style with clang-format for new code
- 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-11-03 09:29:11 +01:00
..
commit-msg
post-merge
pre-commit Enforce coding style with clang-format for new code 2017-11-03 09:29:11 +01:00
README

Git hooks are executable scripts you can place in $GIT_DIR/hooks directory to trigger action at certain points.

To install manually, run:

  cd .git/hooks && ln -s ../../.git-hooks/* ./

There are two groups of these hooks: client side and server side.

The client-side hooks:
are for client operations such as committing and merging.

The server-side hooks:
are for Git server operations such as receiving pushed commits.

See Also [ http://git-scm.com/book/en/Customizing-Git-Git-Hooks ]