Age | Commit message (Collapse) | Author |
|
Only install pre-commit hooks if KDE_CONFIGURE_GIT_PRE_COMMIT_HOOK
is called frm CMAKE_CURRENT_PROEJECT, eg. don't install pre-commit
hooks if ECM is inside a submodule or fetched-content.
|
|
If the module is not included, the current message would be misleading.
Including the module by default is undesirable, because we print out a warning
that we do not override an existing module. While this warning is reasonable in most
cases, it is annoying for projects that have a custom clang-format file.
Checking if a .clang-format file exists and if not including KDEClangFormat is fragile,
because it depends on the include order of the modules.
Considering all that, a proper warning with instructions on how to fix the issue
is IMHO the best way to go.
|
|
I was getting CMake errors in repositories that had a pre-existing commit
hook: `string sub-command FIND requires 3 or 4 parameters.`
Adding quotes around the variables from 6224e7b8c28d434b81a19ac47b88cb58fee9d7d5
fixes this issue for me.
|
|
If the .git/hooks/pre-commit already exists, only add the clang-format line
if it doesn't already exist.
|
|
If clang-format isn't found, there is nothing to write to the file.
|
|
Otherwise, commits will be rejected because the hook cannot be found from the workdir root dir (there is only one .git directory in a checkout, but commands are run relative to the worktree root dir).
|
|
|
|
Git on Windows provides bash
|
|
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
|
|
It was reported that in case of containerized setups where the
source and build are in different containers the pre-commit
script would reference a file which is another container and
is consequently not found.
To avoid this the script is copied in the source dir and a relative path is defined.
|
|
This makes it more difficult to implement the relative paths.
It would be nice to have, but if we encounter a scenario
where we explicitly need this we can revisit it.
|
|
|
|
|
|
GIT_SILENT
|
|
This will allow us to force QS checks before
the developer commits a change. Currently only
clang-format is supported, but as on #plasma and
https://phabricator.kde.org/T11214 discussed we
might want to add different formatters.
By making the checks configurable we are flexible
and can easily extend it.
|