-
-
Notifications
You must be signed in to change notification settings - Fork 4
style(clang-tidy):Use hh extension for cpp header files #1645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bavulapati
wants to merge
1
commit into
sourcemeta:main
Choose a base branch
from
bavulapati:use-hh-extension-for-cpp-header-files
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
style(clang-tidy):Use hh extension for cpp header files #1645
bavulapati
wants to merge
1
commit into
sourcemeta:main
from
bavulapati:use-hh-extension-for-cpp-header-files
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clang tidy assumes the .h files as C headers. And that makes it not find standard library files like <cassert>, <intializer_list>, <string_view>, etc., Somehow my VSCode also recognises it as C header. ``` make lint cmake --build ./build --config Debug --target clang_tidy gmake[1]: Entering directory '/Users/balakrishna/repos/sourcemeta/core/build' -- Enabling SIMD NEON -- Google Benchmark version: v1.8.5, normalized to 1.8.5 -- Enabling additional flags: -DINCLUDE_DIRECTORIES=/Users/balakrishna/repos/sourcemeta/core/vendor/googlebenchmark/include -- Performing Test HAVE_THREAD_SAFETY_ATTRIBUTES -- success -- Performing Test HAVE_STD_REGEX -- success -- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile -- Performing Test HAVE_POSIX_REGEX -- success -- Performing Test HAVE_STEADY_CLOCK -- success -- Performing Test HAVE_PTHREAD_AFFINITY -- failed to compile -- Configuring done (0.3s) -- Generating done (0.3s) -- Build files have been written to: /Users/balakrishna/repos/sourcemeta/core/build [100%] Analyzing sources using ClangTidy 102 warnings and 1 error generated. Error while processing /Users/balakrishna/repos/sourcemeta/core/src/core/json/include/sourcemeta/core/json.h. /Users/balakrishna/repos/sourcemeta/core/src/core/json/include/sourcemeta/core/json.h:8:1: error: included header json_hash.h is not used directly [misc-include-cleaner,-warnings-as-errors] 8 | #include <sourcemeta/core/json_hash.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 9 | #include <sourcemeta/core/json_value.h> /Users/balakrishna/repos/sourcemeta/core/src/core/json/include/sourcemeta/core/json.h:48:6: error: variable 'parse_json' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors] 48 | auto parse_json(std::basic_istream<JSON::Char, JSON::CharTraits> &stream, | ^ /Users/balakrishna/repos/sourcemeta/core/src/core/json/include/sourcemeta/core/json.h:88:6: error: variable 'parse_json' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors] 88 | auto parse_json(std::basic_istream<JSON::Char, JSON::CharTraits> &stream, | ^ /Users/balakrishna/repos/sourcemeta/core/src/core/json/include/sourcemeta/core/json_hash.h:4:10: error: 'cassert' file not found [clang-diagnostic-error] 4 | #include <cassert> // assert | ^~~~~~~~~ Suppressed 99 warnings (99 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings treated as errors gmake[4]: *** [CMakeFiles/clang_tidy.dir/build.make:71: CMakeFiles/clang_tidy] Error 1 gmake[3]: *** [CMakeFiles/Makefile2:825: CMakeFiles/clang_tidy.dir/all] Error 2 gmake[2]: *** [CMakeFiles/Makefile2:832: CMakeFiles/clang_tidy.dir/rule] Error 2 gmake[1]: *** [Makefile:257: clang_tidy] Error 2 gmake[1]: Leaving directory '/Users/balakrishna/repos/sourcemeta/core/build' make: *** [lint] Error 2 ``` Signed-off-by: Balakrishna Avulapati <[email protected]>
@jviotti I want to know your thoughts before changing the extension of rest of the headers |
Refs sourcemeta/blaze#429 |
picked up the extension |
That's weird. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clang tidy assumes the .h files as C headers.
And that makes it not find standard library files like , <intializer_list>, <string_view>, etc.,
Somehow my VSCode also recognises it as C header.