clang-format Questions

1

I am using nvim with lazy and using mason, mason-lspconfig, nvim-lspconfig as follow return { { "williamboman/mason.nvim", config = function() require("mason").setup() end,...
Tate asked 9/5, 2024 at 16:31

4

Solved

clang-format is breaking up my lines at 80 columns. Is there a way to make stop breaking lines? The documentation doesn't seem to address this.
Scrimshaw asked 6/12, 2017 at 21:41

6

Solved

I have put a .clang-format file in my workspace. But that formatting is not applied on my code. I have checked the settings and they are set to None for fallback-style and file for clang_format_sty...
Gyral asked 15/3, 2022 at 11:21

3

I am currently using travis ci to check patches as they come into github and am trying to figure out if there is anyway for clang-format 3.9 (since travis ci will only support ubuntu 14.04 currentl...
Paralyze asked 1/6, 2018 at 16:53

2

Solved

This question extends Unify output with different clang-format versions. The problem is that the default behavior of clang-format varies for different version, even for the built-in styles. Quite f...
Meade asked 18/12, 2019 at 15:42

2

Solved

I'm using clang-format (version 8.0.0 (tags/google/stable/2019-01-18)) with a style file, in which I set … PointerAlignment: Left … This succeeds in transforming declarations such as this one cons...
Gorged asked 11/6, 2019 at 6:36

2

Solved

I would like to format the code with clang-format and leave lambda used as a middle function argument intact (as is): void f() { func(0, [] {}, 0); } Everything I was trying in clang-format 9.0 (...
Lawlor asked 22/7, 2019 at 20:55

1

Here is my code: if constexpr (requires { { N::uuid() } -> std::convertible_to<score::uuid_t>; }) clang-format (14, 15) insists in formatting it in 5 lines: if constexpr (requires { { N...
Lianaliane asked 29/6, 2022 at 9:6

1

I've got a clang-format question regarding C++ lambdas. I've noticed new behavior with short, but not on-line lambdas after upgrading to Clang-Format 15.0.1. I call them "Two-line lambdas&quot...
Restivo asked 3/1, 2024 at 20:22

18

Solved

Is there a way to call something like clang-format --style=Webkit for an entire cpp project folder, rather than running it separately for each file? I am using clang-format.py and vim to do this, ...
Fridlund asked 6/3, 2015 at 10:31

4

clang-format has 2 options called BinPackParameters and BinPackArguments. They seem to control how function declarations and function calls are indented. BinPackParameters seems to provide the exp...
Simas asked 5/5, 2015 at 15:44

4

I am trying to use clang-format to clean up code in my repository. We are using the WebKit style as the basis for formatting, however we also want to make sure that multi line comments are formatte...
Pralltriller asked 1/3, 2016 at 0:53

2

Solved

How can I get clang-format to break on '<<' and '>>' operators? I tried setting BreakBeforeBinaryOperators to All, but this does not seem to make any difference here. I would like my code t...
Gladine asked 4/7, 2019 at 5:15

1

Is there a way to get clang-format to turn this: function_name("a very very " | <-- column limit "very very " | "long string"); | into this: function_name("a very very very very long" | "...
Childbirth asked 22/3, 2018 at 23:53

3

I have placed a .clang-format file in my project and can apply the formatting with Ctrl+K, Ctrl+D. I have also configured and enabled "Run Code Cleanup profile on Save" under Options -&gt...
Deformed asked 31/5, 2022 at 14:29

1

clang-format currently moves all pragmas to the first column. An example before clang-format: for (int i = 0; i < 4; ++i) { #pragma UNROLL // ...some code... } The same code after clang-for...
Eugene asked 6/2, 2018 at 9:25

1

Solved

I have the following line in my C++ code: std::cout << "done" << "\n"; which clang-format breaks into std::cout << "done" << "\n"; ...
Prohibit asked 4/8, 2023 at 9:5

1

Solved

We've tried to beautify our code a bit with clang-format tool. In order to get unified result on all machines we've done clang-format --style=llvm --dump-config, which has been tuned a bit and st...
Laminitis asked 18/10, 2019 at 12:25

3

clang-format seems to make a big mess out of blocks like this: desc.add_options()("help", "output usage") ("inputDirectory", po::value<boost::filesystem::path>()->required(), "The input ...
Lonne asked 22/12, 2016 at 17:53

1

Say I have the following C++ code: class Foo { auto foo() { return 0; } // foo auto foofoo() const { return 1000; } // foofoo int bar() const { return 42; } // bar }; How can I get clang-form...
Gash asked 31/12, 2018 at 10:54

4

Solved

In our C++ project, the order of our includes is regularly changed. This is a problem since we are using some third-party libraries which require a specific include order to avoid problems. I kno...
Shelleyshellfire asked 21/2, 2020 at 7:55

2

Solved

Searching through the Clang-Format Style Options, I can't seem to find a way to control the behavior on the placement of C++ attributes. As an example, take these two declarations, the first of wh...
Peddle asked 17/8, 2017 at 16:26

2

I am using pre-commit (version 2.20.0) for my C++ project with this hook: repos: - repo: https://github.com/pre-commit/mirrors-clang-format rev: v14.0.6 hooks: - id: clang-format I just staged ...
Ulphiah asked 12/10, 2022 at 18:50

9

Solved

I am trying to use clang-tools in particular clang-format for automatic code formatting in vim but I couldn't find this tool with apt-get search. Is there anybody experienced this problem before, ...
Squint asked 24/12, 2013 at 7:43

8

Solved

As clang-format is a tool to only reformat code, is it possible that such formatting can break working code or at least change how it works? Is there some kind of contract that it will/can not chan...
Vermicide asked 20/6, 2016 at 16:32

© 2022 - 2025 — McMap. All rights reserved.