This revision was automatically updated to reflect the committed changes.
Closed by commit rL332125: [clang-tidy] Adding RestrictSystemIncludes check to
Fuchsia module (authored by juliehockett, committed by ).
Herald added subscribers: llvm-commits, klimek.
Changed prior to commit:
https://rev
aaron.ballman added inline comments.
Comment at: clang-tidy/fuchsia/RestrictSystemIncludesCheck.h:35
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ bool contains(StringRef FileName) {
+return AllowedIncludesGlobList.contains(FileName);
j
juliehockett added inline comments.
Comment at: clang-tidy/fuchsia/RestrictSystemIncludesCheck.h:35
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ bool contains(StringRef FileName) {
+return AllowedIncludesGlobList.contains(FileName);
aa
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
Thank you for adding the glob feature, I think that will be very powerful in
practice. Aside from a minor nit, this LGTM!
Comment at: clang-tidy/fuchsia/Restri
juliehockett updated this revision to Diff 146349.
juliehockett added a comment.
Updating parameter list to be a glob-style list.
https://reviews.llvm.org/D43778
Files:
clang-tidy/fuchsia/CMakeLists.txt
clang-tidy/fuchsia/FuchsiaTidyModule.cpp
clang-tidy/fuchsia/RestrictSystemIncludesChec
juliehockett reopened this revision.
juliehockett added a comment.
Sorry, branches got crossed. Reverted and reopened.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D43778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http
This revision was not accepted when it landed; it landed in state "Needs
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE331930: [clang-tidy] Adding RestrictSystemIncludes check
to Fuchsia module (authored by juliehockett, committed by ).
R
aaron.ballman added inline comments.
Comment at: docs/clang-tidy/checks/fuchsia-restrict-system-includes.rst:32
+ A string containing a semi-colon separated list of allowed include
filenames.
+ The default is an empty string, which allows all includes.
julie
juliehockett updated this revision to Diff 145978.
juliehockett marked 3 inline comments as done.
juliehockett added a comment.
Updating the inclusiondirective to filter out non-system files
https://reviews.llvm.org/D43778
Files:
clang-tidy/fuchsia/CMakeLists.txt
clang-tidy/fuchsia/FuchsiaT
juliehockett added inline comments.
Comment at: docs/ReleaseNotes.rst:116
+
+ Checks for allowed system includes and suggests removal of any others. If no
+ includes are specified, the check will exit without issuing any warnings.
Eugene.Zelenko wrote:
> Is it
aaron.ballman added inline comments.
Comment at: clang-tidy/fuchsia/RestrictSystemIncludesCheck.cpp:67
+ llvm::SmallDenseMap IncludeDirectives;
+ llvm::StringMap IsSystem;
+
Rather than use this `StringMap`, can you change `InclusionDirective()` to
filter out
Eugene.Zelenko added inline comments.
Comment at: docs/ReleaseNotes.rst:116
+
+ Checks for allowed system includes and suggests removal of any others. If no
+ includes are specified, the check will exit without issuing any warnings.
Is it necessary to highlight
juliehockett updated this revision to Diff 145788.
juliehockett marked 10 inline comments as done.
juliehockett added a comment.
Made the check for system headers more comprehensive & fixed newline issues
https://reviews.llvm.org/D43778
Files:
clang-tidy/fuchsia/CMakeLists.txt
clang-tidy/fu
aaron.ballman added inline comments.
Comment at: clang-tidy/fuchsia/FuchsiaTidyModule.cpp:41
+CheckFactories.registerCheck(
+"fuchsia-restrict-includes");
CheckFactories.registerCheck(
I think this should be named `fuchsia-restrict-system-include
juliehockett updated this revision to Diff 145547.
juliehockett marked 9 inline comments as done.
juliehockett edited the summary of this revision.
juliehockett added a comment.
Sorry for the delay in updating this -- check now restricts includes to a
whitelist, rather than a blacklist, and only
juliehockett added inline comments.
Comment at: clang-tidy/fuchsia/RestrictIncludesCheck.cpp:75
+for (const auto &Include : FileDirectives) {
+ auto D = Check.diag(Include.Loc, "restricted include found");
+
aaron.ballman wrote:
> I believe this check wi
aaron.ballman added inline comments.
Comment at: clang-tidy/fuchsia/RestrictIncludesCheck.cpp:42-44
+SourceLocation Loc; ///< '#' location in the include directive
+CharSourceRange Range; ///< SourceRange for the file name
+std::string Filename; ///< Filename a
juliehockett updated this revision to Diff 136096.
juliehockett marked 16 inline comments as done.
juliehockett added a comment.
Fixing comments and updating tests.
https://reviews.llvm.org/D43778
Files:
clang-tidy/fuchsia/CMakeLists.txt
clang-tidy/fuchsia/FuchsiaTidyModule.cpp
clang-tidy
aaron.ballman added inline comments.
Comment at: clang-tidy/fuchsia/RestrictIncludesCheck.cpp:37-39
+IncludeDirective(SourceLocation Loc_, CharSourceRange Range_,
+ StringRef Filename_)
+: Loc(Loc_), Range(Range_), Filename(Filename_) {}
--
hokein added inline comments.
Comment at: docs/clang-tidy/checks/fuchsia-restrict-includes.rst:27
+
+ A string containing a comma-separated list of header filenames to restrict.
Default is an empty string.
The check seems do nothing with the default option.
D
Eugene.Zelenko added inline comments.
Comment at: clang-tidy/fuchsia/CMakeLists.txt:8
OverloadedOperatorCheck.cpp
+ RestrictIncludesCheck.cpp
StaticallyConstructedObjectsCheck.cpp
Will be good idea to be have consistent name and documentation terminology:
juliehockett created this revision.
juliehockett added reviewers: aaron.ballman, hokein, ilya-biryukov.
juliehockett added a project: clang-tools-extra.
Herald added subscribers: xazax.hun, mgorny.
Adding a check to restrict specific includes. Given a list of includes that
should not be used, the
22 matches
Mail list logo