[clang-tidy] Move fuchsia-restrict-system-includes to portability module for general...
authorPaula Toth <paulatoth@google.com>
Tue, 10 Mar 2020 17:28:23 +0000 (10:28 -0700)
committerPaula Toth <paulatoth@google.com>
Tue, 10 Mar 2020 20:33:06 +0000 (13:33 -0700)
commitebdb98f254f632b506109b9d20c6e8e19697765f
tree0622b4341eeff44951bf26638ac86fca9e8ea4ed
parent5b0c60c58ea426b215cfd2970c9eaa6eb5b42026
[clang-tidy] Move fuchsia-restrict-system-includes to portability module for general use.

Summary:
Created a general check for restrict-system-includes under portability as recommend in the comments under D75332. I also fleshed out the user facing documentation to show examples for common use-cases such as allow-list, block-list, and wild carding.

Removed fuchsia's check as per phosek sugguestion.

Reviewers: aaron.ballman, phosek, alexfh, hokein, njames93

Reviewed By: phosek

Subscribers: Eugene.Zelenko, mgorny, xazax.hun, phosek, cfe-commits, MaskRay

Tags: #clang-tools-extra, #clang

Differential Revision: https://reviews.llvm.org/D75786
26 files changed:
clang-tools-extra/clang-tidy/fuchsia/CMakeLists.txt
clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp
clang-tools-extra/clang-tidy/portability/CMakeLists.txt
clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp
clang-tools-extra/clang-tidy/portability/RestrictSystemIncludesCheck.cpp [moved from clang-tools-extra/clang-tidy/fuchsia/RestrictSystemIncludesCheck.cpp with 97% similarity]
clang-tools-extra/clang-tidy/portability/RestrictSystemIncludesCheck.h [moved from clang-tools-extra/clang-tidy/fuchsia/RestrictSystemIncludesCheck.h with 74% similarity]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/fuchsia-restrict-system-includes.rst [deleted file]
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/docs/clang-tidy/checks/portability-restrict-system-includes.rst [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/Inputs/portability-restrict-system-includes/a.h [moved from clang-tools-extra/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/a.h with 100% similarity]
clang-tools-extra/test/clang-tidy/checkers/Inputs/portability-restrict-system-includes/system/cstdarg.h [moved from clang-tools-extra/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/cstdarg.h with 100% similarity]
clang-tools-extra/test/clang-tidy/checkers/Inputs/portability-restrict-system-includes/system/cstdlib.h [moved from clang-tools-extra/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/cstdlib.h with 100% similarity]
clang-tools-extra/test/clang-tidy/checkers/Inputs/portability-restrict-system-includes/system/j.h [moved from clang-tools-extra/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/j.h with 100% similarity]
clang-tools-extra/test/clang-tidy/checkers/Inputs/portability-restrict-system-includes/system/r.h [moved from clang-tools-extra/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/r.h with 100% similarity]
clang-tools-extra/test/clang-tidy/checkers/Inputs/portability-restrict-system-includes/system/s.h [moved from clang-tools-extra/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/s.h with 100% similarity]
clang-tools-extra/test/clang-tidy/checkers/Inputs/portability-restrict-system-includes/system/t.h [moved from clang-tools-extra/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/t.h with 100% similarity]
clang-tools-extra/test/clang-tidy/checkers/Inputs/portability-restrict-system-includes/system/transitive.h [moved from clang-tools-extra/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/system/transitive.h with 100% similarity]
clang-tools-extra/test/clang-tidy/checkers/Inputs/portability-restrict-system-includes/transitive2.h [moved from clang-tools-extra/test/clang-tidy/checkers/Inputs/fuchsia-restrict-system-includes/transitive2.h with 100% similarity]
clang-tools-extra/test/clang-tidy/checkers/fuchsia-restrict-system-includes-all.cpp [deleted file]
clang-tools-extra/test/clang-tidy/checkers/fuchsia-restrict-system-includes-glob.cpp [deleted file]
clang-tools-extra/test/clang-tidy/checkers/fuchsia-restrict-system-includes.cpp [deleted file]
clang-tools-extra/test/clang-tidy/checkers/portability-restrict-system-includes-allow.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/portability-restrict-system-includes-disallow.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/portability-restrict-system-includes-glob.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/portability-restrict-system-includes-transitive.cpp [moved from clang-tools-extra/test/clang-tidy/checkers/fuchsia-restrict-system-includes-headers.cpp with 54% similarity]