Changes between Version 1 and Version 2 of CodingGuidelines/Jam


Ignore:
Timestamp:
Jan 20, 2023, 11:41:41 AM (2 years ago)
Author:
pulkomandy
Comment:

Add a few more things I can think of

Legend:

Unmodified
Added
Removed
Modified
  • CodingGuidelines/Jam

    v1 v2  
    1 While trying to implement Jam Rules for adding WifiFirmware, Matt and Colin encountered, that there are no written coding guidelines. Thus making it hard to stick to them. This Wiki is intended to fill this
    2 gap, by collecting (reverse engineering?) these guidelines. Thus allowing to get patches - from newcomers to the jam build system - more easily accepted and making Ingos life somewhat easier :)
     1While trying to implement Jam Rules for adding WifiFirmware, Matt and Colin encountered, that there are no written coding guidelines. Thus making it hard to stick to them. This Wiki is intended to fill this gap, by collecting (reverse engineering?) these guidelines. Thus allowing to get patches - from newcomers to the jam build system - more easily accepted and making Ingos life somewhat easier :)
    32
    4  * max. 80 chars per line
    5  * descriptive identifiers (rule names, variable names, action names, ...)
    6  * matt: axel has mentioned wanting two blank lines inbetween rules, actions, anything that looks like a C/C++ function. but i don't know what ingo thinks.
     3Generally use the same rules as for C++:
     4
     5 * max. 100 chars per line
     6 * indent with tabs
     7 * descriptive identifiers (rule names, variable names, action names, ...). Avoid using the $(1), etc style in rules where arguments can easily be named. In actions, this is not possible, so use local variables in the actions that just copy the arguments, but have proper names for them
     8 * two blank lines inbetween rules, actions, anything that looks like a C/C++ function. (this is not usually done in the existing files, should we start doing it?)
     9 * rule and action names use CamelCase
     10 * The action matching a rule is defined right after it, and has the same name suffixed by a '1' character
     11 * All rules are defined in build/jam and then used througout the buildsystem, unless something is really specific to a subdirectory