Edit

kc3-lang/angle/.clang-format

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2020-04-28 10:04:04
    Hash : 1f9e2a8f
    Message : Update .clang-format. Will fix the brace alignment issue. clang-format was finally updated to a newer version in Chromium and the roll of Chromium DEPS picked up the new version. Bug: None Change-Id: I3cb5aa7778fb9bf5a17a5d74dc0b108ba35aafc6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2170406 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> 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:
      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