[llvm-bugs] [Bug 51101] New: .editorconfig

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 14 22:13:41 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51101

            Bug ID: 51101
           Summary: .editorconfig
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nn1436401 at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

.editorconfig ( https://editorconfig.org/ ) is the standard way to define code
formatting and analysis rules.

The main advantage of editorconfig file is filtering options which are
unavailable in Clang Format YAML.

The conversion from YAML to editorconfig can be done straight-forward, for
example:

.clang-format

Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align


.editorconfig

[*.cpp]
clang_format_cpp_access_modifier_offset = -4
clang_format_cpp_align_after_open_bracket = align

# Can specify different rule for a different filter
[tests/*.cpp]
clang_format_cpp_access_modifier_offset = 8

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210715/fa0e60fd/attachment.html>


More information about the llvm-bugs mailing list