Skip to content

Commit

Permalink
[clang-format] Create a python documentation tool to generate a summa…
Browse files Browse the repository at this point in the history
…ry of the clang-format status for the whole of the LLVM project

Summary:
Any change to clang-format is tested with the unit tests, However sometimes the better approach is to run it over a very large fully formatted source tree and then inspect the differences. This seems to be a source of many of the regressions found by @krasimir  and by @sylvestre.ledru and @abpostelnicu who run it over the Mozilla sources, but often these regressions are only found after changes have been committed.

LLVM itself would be a good dog-fooding candidate for similar tests except such a large proportion of the tree is not 100% clang formatted, as such you are never aware if the change comes from a change to clang-format or  just because the tree has not been formatted first.

The following review is for a small python tool which scans the whole of the LLVM source tree and counts the number of files which have one or more clang-format violations.

This revision contains the tool and the output from the initial run of the tool and the generated documentation which looks like the following

Reviewers: krasimir, JakeMerdichAMD, sammccall, curdeius, bollu, alexshap, jdoerfert, DavidTruby, sscalpone

Reviewed By: curdeius

Subscribers: dschuff, aheejin, fedor.sergeev, ilya-biryukov, simoncook, cryptoad, arphaman, jfb, kadircet, mstorsjo, s.egerton, usaxena95, aartbik, phosek, sstefan1, cfe-commits, sylvestre.ledru, Abpostelnicu, krasimir

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D80627
  • Loading branch information
phoad107185 committed May 29, 2020
1 parent e6a404f commit 6f56a58
Show file tree
Hide file tree
Showing 4 changed files with 6,558 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clang/docs/ClangFormat.rst
Expand Up @@ -240,3 +240,8 @@ In an SVN client, you can do:
The option `-U0` will create a diff without context lines (the script would format
those as well).

Current State of Clang Format for LLVM
======================================

The following table :doc:`ClangFormattedStatus` shows the current status of clang-formatting for the entire LLVM source tree.

0 comments on commit 6f56a58

Please sign in to comment.