Edit

kc3-lang/angle/.clang-format

Branch :

  • Show log

    Commit

  • Author : Jiacheng Lu
    Date : 2019-07-19 09:18:55
    Hash : f35f1110
    Message : Add script to apply clang-format on all sources 1. python script wrapper to call clang-format over the whole code base 2. Add clang-format rule `IncludeBlocks: Preserve` to tell clang-format do not merge include blocks 3. Fix existed clang-format issue in code base Bug: angleproject:3532 Change-Id: I289292dc62c2784ff21688065c87c3f3f5538f17 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709720 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>

  • .clang-format
  • # Defines the ANGLE style for automatic reformatting.
    # https://code.google.com/p/angleproject/wiki/CodingStandard
    # See Clang docs: http://clang.llvm.org/docs/ClangFormatStyleOptions.html
    BasedOnStyle: Chromium
    
    # Allow double brackets such as std::vector<std::vector<int>>.
    Standard: Cpp11
    
    # Indent 4 spaces at a time.
    IndentWidth: 4
    
    # Keep lines under 100 columns long.
    ColumnLimit: 100
    
    # Always break before braces
    BreakBeforeBraces: Custom
    BraceWrapping:
    #  TODO(lujc) wait for clang-format-9 support in Chromium tools
    #  AfterCaseLabel: true
      AfterClass: true
      AfterControlStatement: true
      AfterEnum: true
      AfterFunction: true
      AfterNamespace: true
      AfterStruct: true
      AfterUnion: true
      BeforeCatch: true
      BeforeElse: true
      IndentBraces: false
      SplitEmptyFunction: false
      SplitEmptyRecord: false
      SplitEmptyNamespace: false
    
      # Keeps extern "C" blocks unindented.
      AfterExternBlock: false
    
    # Indent case labels.
    IndentCaseLabels: true
    
    # Right-align pointers and references
    PointerAlignment: Right
    
    # ANGLE likes to align things as much as possible.
    AlignOperands: true
    AlignConsecutiveAssignments: true
    
    # Use 2 space negative offset for access modifiers
    AccessModifierOffset: -2
    
    # TODO(jmadill): Decide if we want this on. Doesn't have an "all or none" mode.
    AllowShortCaseLabelsOnASingleLine: false
    
    # Useful for spacing out functions in classes
    KeepEmptyLinesAtTheStartOfBlocks: true
    
    # Indent nested PP directives.
    IndentPPDirectives: AfterHash
    
    # Include blocks style
    IncludeBlocks: Preserve