-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Corrects clang-tidy warnings from atomutilities cpp file #1365
Conversation
Thanks for opening this pull request! Please check out our contributing guidelines and check for the automated tests. |
…nt variables instead of macros: avogadro/core/atomutilities.cpp:12:9: warning: macro 'M_TETRAHED' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] ^ Signed-off-by: Xav83 <[email protected]>
…pedef' for aliases: /home/runner/work/avogadrolibs/avogadrolibs/avogadrolibs/avogadro/core/atomutilities.cpp:16:1: warning: use 'using' instead of 'typedef' [modernize-use-using] typedef Array<Bond> NeighborListType; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ using NeighborListType = Array<Bond> Signed-off-by: Xav83 <[email protected]>
…ed as const references to avoid unecessary copy initialization: /home/runner/work/avogadrolibs/avogadrolibs/avogadrolibs/avogadro/core/atomutilities.cpp:78:13: warning: the variable 'bond1' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization] Vector3 bond1 = allVectors[0]; ^ const & /home/runner/work/avogadrolibs/avogadrolibs/avogadrolibs/avogadro/core/atomutilities.cpp:150:13: warning: the variable 'bond1' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization] Vector3 bond1 = allVectors[0]; ^ const & /home/runner/work/avogadrolibs/avogadrolibs/avogadrolibs/avogadro/core/atomutilities.cpp:151:13: warning: the variable 'bond2' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization] Vector3 bond2 = allVectors[1]; ^ const & /home/runner/work/avogadrolibs/avogadrolibs/avogadrolibs/avogadro/core/atomutilities.cpp:173:13: warning: the variable 'bond1' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization] Vector3 bond1 = allVectors[0]; ^ const & /home/runner/work/avogadrolibs/avogadrolibs/avogadrolibs/avogadro/core/atomutilities.cpp:174:13: warning: the variable 'bond2' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization] Vector3 bond2 = allVectors[1]; ^ const & /home/runner/work/avogadrolibs/avogadrolibs/avogadrolibs/avogadro/core/atomutilities.cpp:175:13: warning: the variable 'bond3' is copy-constructed from a const reference but is only used as const reference; consider making it a const reference [performance-unnecessary-copy-initialization] Vector3 bond3 = allVectors[2]; ^ const & Signed-off-by: Xav83 <[email protected]>
…from 'std::size_t' to 'int': /home/runner/work/avogadrolibs/avogadrolibs/avogadrolibs/avogadro/core/atomutilities.cpp:70:24: warning: narrowing conversion from 'std::vector::size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions] int currentValence = allVectors.size(); ^ Signed-off-by: Xav83 <[email protected]>
Here are the build results |
Thanks! It's been a while since I've run clang-tidy (thus the PR). I wouldn't mind someone looking at If you can post the clang-tidy warnings somewhere, I'd be happy to take a look and suggest some other files / warnings to target. |
Congrats on merging your first pull request! 🎉 Thanks for making Avogadro better for everyone! |
Here are the build results |
@ghutchis Here is the log file from There is no warning found by |
Thanks for the log. Yes, I'm putting together a separate PR on filenames. It's not perfect, but it at least performs some checks. |
Hi OpenChemistry devs 🙂
I am creating this Pull Request in relation with the issue #1346, in the context of Hacktoberfest 2023.
So, as mentioned in the title, this Pull Request corrects the warnings generated by
clang-tidy
in the fileavogadro/core/atomutilities.cpp
. I chose this file because the warnings seemed simple to fix 😄PS: if you have some files where you think clearing the clang-tidy warnings would be important/necessary, I'll be happy to do it in another Pull Request 😉
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.