diff --git a/GhidraDocs/GhidraCodingStandards.html b/GhidraDocs/GhidraCodingStandards.html index 00b9b551d1..37345a7b9e 100644 --- a/GhidraDocs/GhidraCodingStandards.html +++ b/GhidraDocs/GhidraCodingStandards.html @@ -90,6 +90,14 @@
  • DefaultFoo - A "default" implementation that would be appropriate for the majority of use cases.
  • {descriptive}Foo - Other implementations should describe what makes them unique.
  • +

    The design pattern for using an abstract base class without a corresponding interface should use the following naming conventions:

    +

    Test class names should end with "Test" (e.g., FooTest).

    Test doubles or stub objects should use the following naming rules:

    Local variables should be declared when first needed and not at the top of the method and should be @@ -212,6 +220,26 @@

    Indenting

    New blocks are indented using a tab character (the tab should be 4 spaces wide).

    Line continuation should be indented the same as a new block.

    +

    Special Formatting

    +

    If special formatting is required to make code readable, you may surround the + statement or code block with the eclipse formatter tags. For example, +
    +	public String toString() {
    +		//@formatter:off
    +		return "{\n" +
    +			"\tname: " + name + ",\n" +
    +			"\tmodelColumn" + modelIndex + ",\n" +
    +			"\tviewColumn: " + viewIndex + ",\n" +
    +			"\tconstraints: " + 
    +				CollectionUtils.collect(applicableConstraints, c -> c.asString()) +"\n" +
    +		"}";
    +		//@formatter:on
    +	} 
    +					
    +

    + +

    Do not use empty end-of-line comments "//" to trick eclipse into not formatting the line.

    +

    Braces

    Braces should always be used where optional.

    Braces should follow the Kernighan and Ritchie style for nonempty blocks and block-like structures.