[Webkit-unassigned] [Bug 103605] [CMake] Unify coding style for CMake files

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 30 00:43:58 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=103605





--- Comment #7 from Patrick R. Gansterer <paroga at paroga.com>  2012-11-30 00:46:14 PST ---
(In reply to comment #6)
+1 for changing the style.

> > Where are all these rules coming from ? Are these custom for other projects as well ? Have you looked at other styles, like http://techbase.kde.org/Policies/CMake_Coding_Style (i just picked one, it does not mean that that is the one we should take as a base).
> 
> As I said, I just use mostly used coding style that files under Source/cmake/. Referred to http://www.webkit.org/coding/coding-style.html, http://techbase.kde.org/Policies/CMake_Coding_Style and existing cmake 2.8 modules, I'd like to draft the coding style rules as following:
> 1. Indentation
> 1.1 Use spaces, not tabs(Indentation rule 1 in webkit C/C++ coding style)
> 1.2 4-space as indent(Indentation rule 2 in webkit C/C++ coding style)
Agree.

> 2. Spacing
> 2.1 Place spaces between control statements and their parentheses. (Spacing rule 4 in webkit C/C++ coding style), IF (), ELSE (), ENDIf(), FOREACH ()
Agree.

> 2.2 Place spaces between function and macro statements and their parentheses. MACRO (), ENDMACRO (), FUNCTION (), ENDFUNCTION (). Same as 2.1
I have no strong opinion on this, but if we say that a macro/function is something like a macro/function/method in C/C++, I think that no space would meet the WebKit C/C++ coding style more.

> 2.3 Do not place spaces between a function or macro and its parentheses, or between a parenthesis and its content. (Spacing rule 4 in webkit C/C++ coding style), MESSAGE("testing") not MESSAGE( "testing") or MESSAGE ("testing")
Agree.

> 3. Uppercase when call macros and functions. ADD_EXECUTABLE() not add_executable(), SET() not set(). (Referred cmake 2.8 modules) 
AFAIK all lowercase is the "new" CMake style. If you look at new code added to the CMake repository, it is usually lowercase. Also the documentation at http://www.cmake.org/cmake/help/v2.8.10/cmake.html uses lowercase.

Any ideas about adding a CMake codeing style checker? Or at least a well know place to put this new rules, so we can refer to it, when seeing violations?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list