Instead of regex, to allow for negative globs.
Rename HeaderFilterRegex to HeaderFilter,
to keep it consistent.
Fix existing usage of HeaderFilter in the codebase.
Add unit test excluding one directory.
Paths
| Differential D112720
[clang-tidy] Use globs in HeaderFilter AbandonedPublic Authored by carlosgalvezp on Oct 28 2021, 7:37 AM.
Details
Summary Instead of regex, to allow for negative globs. Rename HeaderFilterRegex to HeaderFilter, Fix existing usage of HeaderFilter in the codebase. Add unit test excluding one directory.
Diff Detail Event TimelineComment Actions Not in favor of general directions like this. Comment Actions
Yep, it's a breaking change. The purpose of this patch is mostly to show how it would look like and see if that would be the desired result. There's 2 aspects of it:
I suppose I can keep the exact same behavior as master, but that will add additional tweaks and complexity to the GlobList class. Comment Actions Just to clarify, this patch is the solution proposed by @alexfh here: https://reviews.llvm.org/D34654#3022728 Comment Actions As long as this blankedly breaks/regresses existing configs it's a non-starter i think. This revision now requires changes to proceed.Oct 28 2021, 10:45 AM Comment Actions
I see, thanks for the input! I'm curious if there are any deprecation mechanisms for clang-tidy? Or can it only be updated in a backwards-compatible way? As seen in the other referenced patch, the backwards-compatible solution is to add yet another configurable parameter - ExcludedHeaderFilterRegex, which only contributes to more user confusion. Or keep calling the parameter HeaderFilterRegex and switch the implementation to something that is not a regex - even more confusion to the users. Personally I think it would be good to have such mechanisms to be able to improve on existing design (not just add more functionality). It's impossible to predict the future so decisions that made total sense in the past might need to be revised later to adapt to user needs. Comment Actions Assuming this is the change we want, Comment Actions Makes total sense, thanks for the suggestion! I'll wait for more reviewers to see if this behavior is what we want at all. If so I can revert the breaking changes and introduce that option. Comment Actions So after some thoughts, I came up with the following plan:
Does that sound good? Looking forward to your feedback.
Revision Contents
Diff 383036 clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
clang-tools-extra/clang-tidy/ClangTidyOptions.h
clang-tools-extra/clang-tidy/ClangTidyOptions.cpp
clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/index.rst
clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
clang-tools-extra/test/clang-tidy/checkers/altera-id-dependent-backward-branch.cpp
clang-tools-extra/test/clang-tidy/checkers/altera-single-work-item-barrier.cpp
clang-tools-extra/test/clang-tidy/checkers/altera-struct-pack-align-no-crash.cpp
clang-tools-extra/test/clang-tidy/checkers/altera-struct-pack-align.cpp
clang-tools-extra/test/clang-tidy/checkers/altera-unroll-loops.cpp
clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-macro-usage.cpp
clang-tools-extra/test/clang-tidy/checkers/google-namespaces.cpp
clang-tools-extra/test/clang-tidy/checkers/google-readability-casting.c
clang-tools-extra/test/clang-tidy/checkers/misc-unused-parameters.cpp
clang-tools-extra/test/clang-tidy/checkers/modernize-concat-nested-namespaces.cpp
clang-tools-extra/test/clang-tidy/checkers/modernize-pass-by-value-header.cpp
clang-tools-extra/test/clang-tidy/checkers/modernize-pass-by-value-multi-fixes.cpp
clang-tools-extra/test/clang-tidy/checkers/portability-restrict-system-includes-transitive.cpp
clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-multiple-styles.cpp
clang-tools-extra/test/clang-tidy/checkers/zircon-temporary-objects.cpp
clang-tools-extra/test/clang-tidy/infrastructure/Inputs/config-files/.clang-tidy
clang-tools-extra/test/clang-tidy/infrastructure/Inputs/config-files/1/.clang-tidy
clang-tools-extra/test/clang-tidy/infrastructure/Inputs/config-files/3/.clang-tidy
clang-tools-extra/test/clang-tidy/infrastructure/Inputs/overlapping/o.h
clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-mac-libcxx.cpp
clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-run-with-database.cpp
clang-tools-extra/test/clang-tidy/infrastructure/config-files.cpp
clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
clang-tools-extra/test/clang-tidy/infrastructure/file-filter-symlinks.cpp
clang-tools-extra/test/clang-tidy/infrastructure/file-filter.cpp
clang-tools-extra/test/clang-tidy/infrastructure/line-filter.cpp
clang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-error-within-include.cpp
clang-tools-extra/test/clang-tidy/infrastructure/overlapping.cpp
clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
libc/src/.clang-tidy
libc/test/src/CMakeLists.txt
|