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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 29 23:42:19 PST 2012


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





--- Comment #6 from Halton Huo <halton.huo at gmail.com>  2012-11-29 23:44:34 PST ---
Thanks for all the comments, glad to know coding style change is welcomed.

(In reply to comment #2)

As Laszlo suggest, change the summary to "[CMake] Unify coding style for CMake files"

> What about other files that CMake takes as input - e.g. CMakeLists.txt ?
In this change I do not touch other cmake files like Findxxx.cmake and CMakeLists.txt. But I can include all of them, which is all .cmake and  CMakeLists.txt files. But before that we need define a coding style for CMake files in WebKit project.

> 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)
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 ()
2.2 Place spaces between function and macro statements and their parentheses. MACRO (), ENDMACRO (), FUNCTION (), ENDFUNCTION (). Same as 2.1
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")
3. Uppercase when call macros and functions. ADD_EXECUTABLE() not add_executable(), SET() not set(). (Referred cmake 2.8 modules) 

Please let me know your comments and suggestions before I submit a new patch.

-- 
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