Edit

kc3-lang/angle/.clang-format

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2015-07-20 10:14:54
    Hash : 2fdd3da9
    Message : Add clang-format integration for 'git cl format'. This will allow us to eventually make a presubmit script for ANGLE, and also will help new contributors who aren't as familiar with the style guide. One outstanding issue is the lack of proper breaking before array initializers. We don't use arrays all over the place, but this will likely require a patch for clang. BUG=angleproject:762 Change-Id: I4702b1fcdfa10b7682b07316be59ec67bcf84943 Reviewed-on: https://chromium-review.googlesource.com/285901 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: 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: Allman
    
    # 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