Add three additional rules to the KDE coding guidelines for CMake source code

Albert Astals Cid aacid at kde.org
Mon Aug 5 23:43:47 BST 2024


El dimecres, 31 de juliol del 2024, a les 9:38:06 (CEST), Ingo Klöcker va 
escriure:
> On Mittwoch, 31. Juli 2024 01:48:55 CEST Marius P wrote:
> > Can we please modify the KDE coding guidelines for CMake source code
> > https://community.kde.org/Policies/CMake_Coding_Style
> > Such that we do not allow the following three issues:
> > 
> > 1. kconfig/src/core/CMakeLists.txt:36: Mismatching spaces inside ()
> > after command [whitespace/mismatch]:
> > "configure_file(config-kconfig.h.cmake
> > ${CMAKE_CURRENT_BINARY_DIR}/config-kconfig.h )"
> > 
> > 2. kconfig/CMakeLists.txt:74: Extra spaces between 'include' and its
> > () [whitespace/extra]:
> > "include (ECMPoQmTools)"
> > 
> > 3. kcalc/CMakeLists.txt:96: Line ends in whitespace [whitespace/eol]:
> > "   kcalc_const_menu.cpp "
> 
> If we want this (and I guess it makes sense the same way using clang-format
> and the other linters makes sense) then we should add a cmake linter CI job
> and maybe also a pre-commit hook. Maybe both as opt-in in case some projects
> want to keep using their own style (or maybe cmakelint is customizable?).
> This would likely reduce most of the CMake_Coding_Style policy (which,
> frankly, I wasn't even aware of and never looked for) to a simple
> "cmakelint must pass".

My main concern here is that cmakelint seems to be just a "random" project 
someone started, not something coming from cmake or a "famous cmake person"

It also seems to have some maintainership issues
   https://github.com/cmake-lint/cmake-lint/issues/27

But if i'm the only one with those worries, I'm not blocking on this.

Cheers,
  Albert

> 
> Regards,
> Ingo






More information about the kde-devel mailing list