[clang-tidy] Adding RestrictSystemIncludes check to Fuchsia module
authorJulie Hockett <juliehockett@google.com>
Wed, 9 May 2018 22:25:42 +0000 (22:25 +0000)
committerJulie Hockett <juliehockett@google.com>
Wed, 9 May 2018 22:25:42 +0000 (22:25 +0000)
commit06af01bbc23d422df3bbac82752b935fa217893d
tree631899d68ee85b2dad89bcb57ad88ab5a82d8d68
parent4f729f6a67337f060bab519101c0a0081cae627f
[clang-tidy] Adding RestrictSystemIncludes check to Fuchsia module

Adding a check to restrict system includes to a whitelist. Given a list
of includes that are explicitly allowed, the check issues a fixit to
remove any system include not on that list from the source file.

Differential Revision: https://reviews.llvm.org/D43778

llvm-svn: 331930
16 files changed:
clang-tools-extra/clang-tidy/fuchsia/CMakeLists.txt
clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp
clang-tools-extra/clang-tidy/fuchsia/RestrictSystemIncludesCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/fuchsia/RestrictSystemIncludesCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/fuchsia-restrict-system-includes.rst [new file with mode: 0644]
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/a.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/system/j.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/system/r.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/system/s.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/system/t.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/system/transitive.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/transitive2.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes-headers.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/fuchsia-restrict-system-includes.cpp [new file with mode: 0644]