-
Notifications
You must be signed in to change notification settings - Fork 404
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
iox-#889 Fix clang-tidy violations for iceoryx_hoofs package #895
iox-#889 Fix clang-tidy violations for iceoryx_hoofs package #895
Conversation
Codecov Report
@@ Coverage Diff @@
## master #895 +/- ##
==========================================
+ Coverage 75.71% 76.14% +0.43%
==========================================
Files 335 335
Lines 12222 12267 +45
Branches 2038 2051 +13
==========================================
+ Hits 9254 9341 +87
+ Misses 2178 2134 -44
- Partials 790 792 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
1e2ad20
to
5192133
Compare
iceoryx_hoofs/source/posix_wrapper/shared_memory_object/memory_map.cpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/source/posix_wrapper/shared_memory_object/shared_memory.cpp
Outdated
Show resolved
Hide resolved
b919c49
to
1e2ff41
Compare
@elBoberido @elfenpiff @dkroenke please take a look this PR fixes clang-tidy violations in iceoryx_hoofs |
iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/message_queue.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/message_queue.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/mutex.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/unix_domain_socket.hpp
Outdated
Show resolved
Hide resolved
e387304
to
6b73bcb
Compare
@elBoberido @elfenpiff @dkroenke @mossmaurice Sorry for a huge PR. If you have time please take a look. And I welcome any suggestions. There is also a new CI job that runs clang-tidy check for iceoryx_hoofs package. |
iceoryx_hoofs/include/iceoryx_hoofs/design_pattern/creation.hpp
Outdated
Show resolved
Hide resolved
173647e
to
a8b96c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just skimmed over some files and didn't do a thorough review. Is this really a PR with 12858 insertions and 365 removals? I think there is something fishy. Do we maybe have a line ending change?
It would also have been better to create multiple PRs for this since it has quite some changes where small details have a big impact ebeded in an ocean of trivial changes.
void creationMove(Creation<Class, Error>& lhs, Creation<Class, Error>&& rhs) noexcept | ||
{ | ||
using CreationPattern_t = Creation<Class, Error>; | ||
lhs.operator=(std::forward<CreationPattern_t>(rhs)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't do it this way. With this you still have to do creationMove(*this, std::move(rhs))
which caused the linter warnings or creationMove(*this, std::move(*static_cast<Creation<Foo>*>(&rhs)))
which we want to prevent with this method.
Please rewrite this to
void creationMove(Creation<Class, Error>& rhs)
{
*this = std::move(rhs);
}
On the caller site this would be just a creationMove(rhs);
.
This might cause some warnings though. In this case, please use a macro.
m_name = std::move(rhs.m_name); | ||
m_fd = std::move(rhs.m_fd); | ||
m_fd = rhs.m_fd; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert and check that all the code changes doing similar stuff is also reverted
m_name = std::move(rhs.m_name); | ||
// NOLINTNEXTLINE(hicpp-move-const-arg) might break silently if object becomes non-trivial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these linter attributes still necessary? If yes, we need to find a solution which makes them obsolete. It's kind of embarrassing to have these in our code base.
@elfenpiff @elBoberido @r7vme I see that this does not make much sense here with this huge PR, too much open topics and clang-tidy exceptions in the code. I propose that this PR goes into draft state until the reviewers have agreed on migration strategy. |
Maybe some parts can be reverted and and only the non controversial stuff be merged first. The naming for example makes up most of the PR and I think we can all agree on this. Stuff like with the move of the creation pattern should be left out and be done in a follow up. This PR should then also be squashed before merging else there are huge intermediate changes which mess up history. There are for sure not 12858 additions in this PR. Something is fishy with that. |
da80989
to
40be2bf
Compare
@elBoberido Maybe that has more chances now. |
The controversial parts are for now excluded and tracked in the ticket
Signed-off-by: Dietrich Krönke <dietrich.kroenke@apex.ai>
Ignoring the generated test toml config in git Signed-off-by: Dietrich Krönke <dietrich.kroenke@apex.ai>
40be2bf
to
ab305a3
Compare
clang-tidy-10
violations in iceoryx_hoofs package.run-clang-tidy
that runs check (w/o failing as agreed with @dkroenke) for iceoryx_hoofsTo test locally:
./tools/ci/run-clang-tidy.sh
Pre-Review Checklist for the PR Author
iox-#123-this-is-a-branch
)iox-#123 commit text
)git commit -s
)task-list-completed
)Notes for Reviewer
Checklist for the PR Reviewer
Post-review Checklist for the PR Author
References