Skip to content

Fix clang-tidy warnings in recently introduced code#3323

Merged
randombit merged 2 commits intomasterfrom
jack/clang-tidy-round6
Mar 1, 2023
Merged

Fix clang-tidy warnings in recently introduced code#3323
randombit merged 2 commits intomasterfrom
jack/clang-tidy-round6

Conversation

@randombit
Copy link
Copy Markdown
Owner

cc @reneme on the TLS session manager changes

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 25, 2023

Codecov Report

Patch coverage: 94.73% and no project coverage change

Comparison is base (f5a3ba9) 88.09% compared to head (8839605) 88.10%.

❗ Current head 8839605 differs from pull request most recent head d90468a. Consider uploading reports for the commit d90468a to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3323   +/-   ##
=======================================
  Coverage   88.09%   88.10%           
=======================================
  Files         615      615           
  Lines       69634    69628    -6     
  Branches     6908     6905    -3     
=======================================
+ Hits        61342    61343    +1     
+ Misses       5412     5400   -12     
- Partials     2880     2885    +5     
Impacted Files Coverage Δ
src/tests/test_tls_rfc8448.cpp 91.03% <0.00%> (ø)
src/lib/tls/tls_session_manager.cpp 94.82% <100.00%> (ø)
src/lib/tls/tls_session_manager_hybrid.cpp 96.96% <100.00%> (ø)
src/lib/tls/tls_session_manager_memory.cpp 82.75% <100.00%> (ø)
src/lib/tls/tls_session_manager_stateless.cpp 93.75% <100.00%> (ø)
src/tests/test_ffi.cpp 96.32% <100.00%> (-0.01%) ⬇️
src/tests/test_tls_session_manager.cpp 95.61% <100.00%> (+<0.01%) ⬆️
src/fuzzer/barrett.cpp 66.66% <0.00%> (-5.56%) ⬇️
src/fuzzer/uri.cpp 75.00% <0.00%> (-5.00%) ⬇️
src/fuzzer/mode_padding.cpp 94.64% <0.00%> (-1.85%) ⬇️
... and 8 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Copy Markdown
Collaborator

@reneme reneme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Is there something that stops us from running clang-tidy in CI to catch those issues early?

Comment on lines +109 to +110
const auto& [_, session_and_handle] = item;
const auto& [__, this_handle] = session_and_handle;

const auto& [_unused, this_handle] = session_and_handle;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe _unused1 and _unused2 for consistency? I found double-underscore was kind-of good enough to work around the 'repeated identifier' issue. But if clang-tidy doesn't like that, so be it.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's fine. For context the complaint here is because C++ reserves all identifiers containing __ for the implementation.

@randombit
Copy link
Copy Markdown
Owner Author

The main reason to not run it in CI is runtime. It takes about 15 minutes to run clang-tidy over the entire codebase on my 4 core + HT machine. So might take as long as an hour on the GH Actions images.

Maybe we can hack up something that only runs it over source files that changed in a PR - that will still miss some problems but would catch the majority before merge, which would be an improvement over the current situation.

@randombit randombit merged commit d07c600 into master Mar 1, 2023
@randombit randombit deleted the jack/clang-tidy-round6 branch March 1, 2023 13:01
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.

3 participants