1

Is it possible to have clang-format issue output as warnings saying what to fix similar to clang tidy. I would prefer to use clang-format due to the ease of setting up styles.

1 Answers1

0

Clang-format has the -output-replacements-xml option.

The xml output will tell you what changes and where to apply. You can then use it raw or parse it in any way that suits you.

Sample:

<?xml version='1.0'?>
<replacements xml:space='preserve' incomplete_format='false'>
<replacement offset='337' length='8'>&#13;&#10;&#13;&#10;  </replacement>
</replacements>
....etc
pablo285
  • 2,460
  • 4
  • 14
  • 38