Comments (5)
I am not familiar with GitHub CI, but it is not that hard to run clang-tidy. It can be configured with a lot of checks, but then someone have to work in months to fix all warnings. I was experimenting a little with this repository to see what checks that could be a good start and came up with this:
cmake -Bbuild -H. -DCMAKE_CXX_COMPILER=clang++-15 -DASYNC_MQTT_USE_TLS=ON -DASYNC_MQTT_USE_WS=ON -DASYNC_MQTT_USE_STR_CHECK=ON -DASYNC_MQTT_USE_LOG=ON -DASYNC_MQTT_PRINT_PAYLOAD=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DASYNC_MQTT_BUILD_UNIT_TESTS=ON -DASYNC_MQTT_BUILD_SYSTEM_TESTS=ON -DASYNC_MQTT_BUILD_TOOLS=ON -DASYNC_MQTT_BUILD_EXAMPLES=ON
run-clang-tidy-15 -p build -checks='clang-analyzer-*,concurrency-*,portability-*' -header-filter=.include > clang-tidy.txt
That gives a lot of warnings, but almost everything ends at the same function:
/tmp/async_mqtt/include/async_mqtt/util/scope_guard.hpp:18:5: note: Address of stack memory associated with local variable 'deleter' is still referred to by the stack variable 'guard' upon returning to the caller. This will be a dangling reference
return std::unique_ptr<void, decltype(deleter)>(&deleter, force_move(deleter));
It also found the bug mentioned in this issue.
from async_mqtt.
Thank you for giving the information. It helps introducing clang-tidy to async_mqtt. I will try it later :)
from async_mqtt.
I ran run-clang-tify
on my local environment. It seems that it is too heavy to run on CI.
I've fixed all clang-tidy warnings under include/async_mqtt
directory.
Other warnings are intentional static_assert()
error as expected in the test code and some tools force exit. It is not related to users.
from async_mqtt.
Thanks you for reporting the issue. You are right. It shoul be fixed. I just create a pull request to fix it #144
BTW, CI doesn't report the warning (as error), so far.
In CI https://github.com/redboltz/async_mqtt/blob/4c022b7e9c650a9f0b1673fb483151affb1f577d/.github/workflows/gha.yml
I use clang++ but not use clang-tidy.
I don't have much about clang-tidy but it seems to useful to find this kinds of issue. If you create a PR to add clang-tify on CI. I would appreciate.
from async_mqtt.
That is great!
If you want, I can do a pull request (not today), where we include clang-tidy as an optional choice that can be activated when choosing clang as a compiler.
Is it too heavy for the CI, so that it fails, or do you think that the build time have increased too much?
Anyway, if it is added to the cmake structure, it will only use the number of threads you specify. Then it can probably be run, if it failed on CI.
from async_mqtt.
Related Issues (20)
- bench wss mode memory error HOT 1
- Add doxygen comment to v5 publish packet HOT 1
- Doxygen document generation brokern HOT 1
- shared_ptr_array seems to confitional C++14 or C++17
- Free function document is not generated even if doxygen style commen is added HOT 1
- Support default completion token HOT 1
- Update document(ascii doc part) about multi threading HOT 1
- bind_executor should be done user's side if needed not in the library HOT 3
- Added C++ version requirement (C++17 or later) to the document HOT 1
- Refine document generation
- re-design error handling HOT 1
- Server Keep Alive override check HOT 1
- ASYNC_MQTT_SEPARATE_COMPILATION HOT 2
- Add get_endpoint() to client HOT 1
- Issue when destroying am::client HOT 2
- install broker HOT 4
- coroutine async_send error_code return variable HOT 7
- Internal Compiler Error on compilation HOT 8
- Compile error when ASYNC_MQTT_USE_TLS=ON and/or ASYNC_MQTT_USE_WS=ON HOT 6
- Is there a way to get the error code if async_underlying_handshake fails due to server_unavailable? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async_mqtt.