aboutsummaryrefslogtreecommitdiff
path: root/kde-modules/KDEGitCommitHooks.cmake
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2021-04-17 11:02:00 +0200
committerFriedrich W. H. Kossebau <kossebau@kde.org>2021-04-23 17:49:14 +0000
commit5512e03562694ebfe571a3b6068a7d35d9ddfd7a (patch)
tree3caca041d3526c8427ec3065642b41a52ad8578c /kde-modules/KDEGitCommitHooks.cmake
parent38b5d046c4d42232d45bf4464167b2e6feea4cf7 (diff)
downloadextra-cmake-modules-5512e03562694ebfe571a3b6068a7d35d9ddfd7a.tar.gz
extra-cmake-modules-5512e03562694ebfe571a3b6068a7d35d9ddfd7a.tar.bz2
Modules docs: move rst docs into bracket comments
CMake >= 3.0 supports bracket comments, and the reStructuredText integration code in sphinx/ext/ecm.py already supports extracting the docs from a bracket comment instead. Editing documentation without leading line comment markers is more simple, e,g. when reflowing text over lines. With ECM meanwhile requiring CMake 3.5 now it is possible to switch (and thus follow also the approach used by cmake itself). NO_CHANGELOG
Diffstat (limited to 'kde-modules/KDEGitCommitHooks.cmake')
-rw-r--r--kde-modules/KDEGitCommitHooks.cmake74
1 files changed, 37 insertions, 37 deletions
diff --git a/kde-modules/KDEGitCommitHooks.cmake b/kde-modules/KDEGitCommitHooks.cmake
index 7bbd024c..761175f1 100644
--- a/kde-modules/KDEGitCommitHooks.cmake
+++ b/kde-modules/KDEGitCommitHooks.cmake
@@ -1,44 +1,44 @@
-#.rst:
-# KDEGitCommitHooks
-# --------------------
-#
-# This module provides a functionality to enforce formatting
-# or in the future other QS checks.
-#
-# This module provides the following function:
-#
-# ::
-#
-# kde_configure_pre_commit_hook(
-# CHECKS <check1> [<check2> [...]]
-# )
-#
-# This function will create a pre-commit hook which contains all the given checks.
-#
-# Checks:
-#
-# - ``CLANG_FORMAT`` With this check enabled the ``git clang-format`` tool will be used to make sure that
-# the changed parts are properly formatted. In case the changes are not properly formatted an error
-# message with the command to preview the formatting changes and to format the files in place
-# will be displayed. This tool will reuse the exsting ``.clang-format`` file, in case you
-# want to use the one provided by ECM you can include ``include(KDEClangFormat)`` which will copy
-# the file to the source dir. It is also recommended to reformat the entire project before enforcing
-# the formatting using this commit hook.
-#
-# Example usage:
-#
-# .. code-block:: cmake
-#
-# include(KDEGitCommitHooks)
-# kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
-#
-# Since 5.79
-
-#=============================================================================
# SPDX-FileCopyrightText: 2020 Alexander Lohnau <alexander.lohnau@gmx.de>
#
# SPDX-License-Identifier: BSD-3-Clause
+#[=======================================================================[.rst:
+KDEGitCommitHooks
+--------------------
+
+This module provides a functionality to enforce formatting
+or in the future other QS checks.
+
+This module provides the following function:
+
+::
+
+ kde_configure_pre_commit_hook(
+ CHECKS <check1> [<check2> [...]]
+ )
+
+This function will create a pre-commit hook which contains all the given checks.
+
+Checks:
+
+- ``CLANG_FORMAT`` With this check enabled the ``git clang-format`` tool will be used to make sure that
+ the changed parts are properly formatted. In case the changes are not properly formatted an error
+ message with the command to preview the formatting changes and to format the files in place
+ will be displayed. This tool will reuse the exsting ``.clang-format`` file, in case you
+ want to use the one provided by ECM you can include ``include(KDEClangFormat)`` which will copy
+ the file to the source dir. It is also recommended to reformat the entire project before enforcing
+ the formatting using this commit hook.
+
+Example usage:
+
+.. code-block:: cmake
+
+ include(KDEGitCommitHooks)
+ kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
+
+Since 5.79
+#]=======================================================================]
+
# try to find clang-format in path
find_program(KDE_CLANG_FORMAT_EXECUTABLE clang-format)
include(CMakeParseArguments)