<commit_before>CMake coding guide
==================

* Keep the length of the line below *80* characters when possible,
  and when it does not hurt readibility, and below *100* characters
  at any case.

* Indentation is made with *two spaces*

* No trailing whitespace are allowed.

* Every text file must be pushed using +UNIX line endings+. (On windows, you are
advised to set +core.autocrlf+ to +true+).

* Never use old CMake syntax code for loop constructs:

[source, cmake]
----

# NO
if(foo)
  ...
else(foo)
  ...
endif(foo)

# YES
if(foo)
  ...
else()
  ...
endif()

----

* Although CMake is rather leniant with case sensitivity, please write every function
*lower-case*, and separate words by *underscores*

[source, cmake]
----
#NO
function(QI_MY_WONDERFUL_FUNCTION)

  ...

endfunction()

#YES
function(qi_my_nice_function)

  ...

endfunction()
----

* Every function in the public API of +qiBuild+ code (i.e: that could en up in
a user cmake code) *must* start with +qi+, other should not start with +qi+ (prefer using _qi for example).

* The link:http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:CMakeParseArguments[CMakeParseArguments]
module is very useful, please use it.

* Every function in the *public* API *must* have corresponding documentation. It works
a bit like +Doxygen+, but with the asciidoc syntax.

[source, cmake]
----
#! foobar : this function foo then bar! (small description)
#
# this is a long description for the function, the function have two parameters,
# accept two flags, two params and two groups.
#
# Paragraph separated by blank lines
#
# \argn: a list of optional arguments
# \arg:first_arg the first argument
# \arg:second_arg the second argument
# \param:PARAM1 PARAM1 specify the fooness of the function
# \param:PARAM2 PARAM2 should always be 42
# \group:GROUP1 GROUP1 is a list of project to foo
# \group:GROUP2 This group represent optional project to pass to bar
#
function(foobar first_arg second_arg)
  cmake_parse_arguments(ARG "FLAG1;FLAG2" "PARAM1;PARAM2" "GROUP1;GROUP2" ${ARGN})
endfunction()
----<commit_msg>doc: add coding style for strings<commit_after>CMake coding guide
==================

* Keep the length of the line below *80* characters when possible,
  and when it does not hurt readibility, and below *100* characters
  at any case.

* Indentation is made with *two spaces*

* No trailing whitespace are allowed.

* Every text file must be pushed using +UNIX line endings+. (On windows, you are
advised to set +core.autocrlf+ to +true+).

* Never use old CMake syntax code for loop constructs:

[source, cmake]
----

# NO
if(foo)
  ...
else(foo)
  ...
endif(foo)

# YES
if(foo)
  ...
else()
  ...
endif()

----

* Although CMake is rather leniant with case sensitivity, please write every function
*lower-case*, and separate words by *underscores*

[source, cmake]
----
#NO
function(QI_MY_WONDERFUL_FUNCTION)

  ...

endfunction()

#YES
function(qi_my_nice_function)

  ...

endfunction()
----

* Every function in the public API of +qiBuild+ code (i.e: that could en up in
a user cmake code) *must* start with +qi+, other should not start with +qi+ (prefer using _qi for example).

* The link:http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:CMakeParseArguments[CMakeParseArguments]
module is very useful, please use it.

* Please don't use C-like construct for strings spanning on several lines:

[source, cmake]
----
message(STATUS  "This is a very long\n"
                "message on\n"
                "several lines\n"
)
----

Rather use nice CMake feature for this:

[source, cmake]
----
message(STATUS "This is a very long
message spanning on
several lines
")
----

See link:http://www.cmake.org/cmake/help/syntax.html[CMake syntax]

* Every function in the *public* API *must* have corresponding documentation. It works
a bit like +Doxygen+, but with the asciidoc syntax.

[source, cmake]
----
#! foobar : this function foo then bar! (small description)
#
# this is a long description for the function, the function have two parameters,
# accept two flags, two params and two groups.
#
# Paragraph separated by blank lines
#
# \argn: a list of optional arguments
# \arg:first_arg the first argument
# \arg:second_arg the second argument
# \param:PARAM1 PARAM1 specify the fooness of the function
# \param:PARAM2 PARAM2 should always be 42
# \group:GROUP1 GROUP1 is a list of project to foo
# \group:GROUP2 This group represent optional project to pass to bar
#
function(foobar first_arg second_arg)
  cmake_parse_arguments(ARG "FLAG1;FLAG2" "PARAM1;PARAM2" "GROUP1;GROUP2" ${ARGN})
endfunction()
----
{'fraction_non_alphanumeric': 0.11400651465798045, 'fraction_numerical': 0.009554831704668839, 'mean_word_length': 3.88441145281018, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7628449', 'n_tokens_mistral': 1507, 'n_tokens_neox': 1437, 'n_words': 571}