Skip to content

include all (internal non-generated) headers in clang-tidy checks#4100

Merged
danmar merged 4 commits intocppcheck-opensource:mainfrom
firewave:tidy-header
Oct 16, 2022
Merged

include all (internal non-generated) headers in clang-tidy checks#4100
danmar merged 4 commits intocppcheck-opensource:mainfrom
firewave:tidy-header

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

No description provided.

@firewave firewave changed the title include all headers in clang-tidy checks include all headers in clang-tidy checks / added CMake option EXTERNALS_AS_SYSTEM May 11, 2022
@firewave firewave force-pushed the tidy-header branch 2 times, most recently from ac35cb8 to 1d580f5 Compare May 12, 2022 08:16
@firewave firewave changed the title include all headers in clang-tidy checks / added CMake option EXTERNALS_AS_SYSTEM include all headers in clang-tidy checks Jun 6, 2022
@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented Jun 6, 2022

The EXTERNALS_AS_SYSTEM CMake option will be removed from this since it is not necessary and can be solved via a more selective regular expression.

@firewave firewave changed the title include all headers in clang-tidy checks include all (internal) headers in clang-tidy checks Jun 6, 2022
@firewave firewave force-pushed the tidy-header branch 2 times, most recently from e680dc6 to 44ba292 Compare September 16, 2022 11:33
@firewave
Copy link
Copy Markdown
Collaborator Author

We need to exclude the generated headers which could be achieved by the (cli|gui|lib|oss-fuzz|test|triage)\/(?!ui_|temp\/).* regular expression but unfortunately LLVM doesn't support negative lookahead in their implementation.

@firewave
Copy link
Copy Markdown
Collaborator Author

We need to exclude the generated headers which could be achieved by the (cli|gui|lib|oss-fuzz|test|triage)\/(?!ui_|temp\/).* regular expression but unfortunately LLVM doesn't support negative lookahead in their implementation.

I adjusted the regex to (cli|gui|lib|oss-fuzz|test|triage)\/[a-z]+\.h so it will only use files from the same depth which achieves the same since the generated files always live in temp subfolders.

@firewave firewave changed the title include all (internal) headers in clang-tidy checks include all (internal non-generated) headers in clang-tidy checks Sep 22, 2022
@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented Oct 11, 2022

I will look into the explicit false positives/suppression in a separate PR. I will file tickets upstream and it seems we might still have some false positives ourselves (or simply some leftover suppressions).

I will also look into the readability-redundant-declaration at a later date as it requires some refactoring and does not cause any issues.

@firewave firewave force-pushed the tidy-header branch 2 times, most recently from 2f222b0 to 234dc00 Compare October 11, 2022 20:10
@firewave firewave marked this pull request as ready for review October 11, 2022 21:47
@danmar danmar merged commit 2ac9fbc into cppcheck-opensource:main Oct 16, 2022
@firewave firewave deleted the tidy-header branch October 16, 2022 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants