Most IDEs have clang-format support built in and can tell you what's wrong
(like a word processor spellchecker). I use vim + ALE, for example. VS Code
also has plugins.
--M
On Wed, Nov 11, 2020 at 11:25 AM Volker Schroer wrote:
> Hi,
>
> I just made a pr and got the message that the pr formatti
Den 11.11.2020 13.28, skrev Johannes Demel:
Hi Gisle,
`file` is not a placeholder but the literal argument. `--style=file` tells `clang-format` to search for a
`.clang-format` file in the current and parent folders.
Oh. But deleting the '%GR_ROOT/.clang-format' and doing a:
clang-format.
Hi Gisle,
`file` is not a placeholder but the literal argument. `--style=file`
tells `clang-format` to search for a `.clang-format` file in the current
and parent folders.
Cheers
Johannes
On 11.11.20 13:19, Gisle Vanem wrote:
Johannes Demel wrote:
unless the clang-format behavior changed,
Johannes Demel wrote:
unless the clang-format behavior changed, the function call should be:
clang-format --style=file -i path/to/file.cc
The `--style=file` option tells clang-format to search for a `.clang-format`
file.
Does not work on Windows (using clang-format v10.0.0).
In a .bat-file
It's apparently not documented, but it works without --style-file as
long as a .clang-format file exists in a directory at or above your
current directory. You can test it with:
clang-format --dump-config
Ron
On 11/11/20 02:53, Johannes Demel wrote:
Hi,
unless the clang-format behavior chan
Hi,
unless the clang-format behavior changed, the function call should be:
clang-format --style=file -i path/to/file.cc
The `--style=file` option tells clang-format to search for a
`.clang-format` file.
Cheers
Johannes
On 11.11.20 11:47, Ron Economos wrote:
I forgot to mention, you have to
I forgot to mention, you have to run clang-format-10 in tree. It gets
the formatting rules from the file .clang-format in the top level directory.
Ron
On 11/11/20 02:41, Ron Economos wrote:
On Ubuntu 20.04:
sudo apt-get install clang-format-10
Then update your changed files.
clang-format-10
On Ubuntu 20.04:
sudo apt-get install clang-format-10
Then update your changed files.
clang-format-10 -i sourcefile.cc
The -i formats the file in place. Otherwise, output is to stdout.
Ron
On 11/11/20 02:20, Volker Schroer wrote:
Hi,
I just made a pr and got the message that the pr formatt
Hi,
I just made a pr and got the message that the pr formatting check
failed. But looking at the output I don't understand, what's wrong.
Even more I'd like to know how I can do the formatting check locally.
The coding guide in the wiki is empty.
Thanks in advance
-- Volker