[cfe-users] clang-format -style=file fails

Kim Gräsman via cfe-users cfe-users at lists.llvm.org
Sun Feb 18 01:26:08 PST 2018


On Sun, Feb 18, 2018 at 10:24 AM, Kim Gräsman <kim.grasman at gmail.com> wrote:
> Hi Ray,
> I think clang-format searches for a ".clang-format" or "_clang-format"
> file by default, so you shouldn't need a -style argument.
> But if you do, it should probably say "-style=file" verbatim, to
> indicate that clang-format should search for a file.
> - Kim
> On Sat, Feb 17, 2018 at 10:14 PM, Ray Mitchell via cfe-users
> <cfe-users at lists.llvm.org> wrote:
>> I'm trying to configure a custom style options file for clang-format v6.0.0
>> running on Windows 10 Pro 64-bit.  I started out by generating a
>> configuration file based upon the llvm style using the following command
>> line, which worked fine:
>>     clang-format -style=llvm -dump-config > .clang-format
>> The documentation for clang-format states the following:
>> "When the desired code formatting style is different from the available
>> options, the style can be customized using the -style="{key: value, ...}"
>> option or by putting your style configuration in the .clang-format or
>> _clang-format file in your project’s directory and using clang-format
>> -style=file."
>> So just as a test I used the unchanged .clang-format file I generated above
>> and used the following command line:
>>     clang-format -style=.clang-format Test.c
>> The result was a message that said "Invalid value for -style".  I then
>> changed the name of .clang-format to _clang-format and tried it again but
>> the result was the same.  So, my question is, "How do I specify a specific
>> style options file?"
>> Thanks!
>> Ray
>> _______________________________________________
>> cfe-users mailing list
>> cfe-users at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

More information about the cfe-users mailing list