Finish clang-tidy cleanups (#3003)

* Add .clang-tidy configuration.
* A separate .clang-tidy is used for hal includes to suppress modernize-use-using
  (as these are C headers).
* Add NOLINT where necessary for a clean run.
* Add clang-tidy job to lint-format workflow.  This workflow is now only run on PRs.
  To reduce runtime, clang-tidy is only run on files changed in the PR.

Two wpilibc changes; both are unlikely to break user code:
* BuiltInAccelerometer: Make SetRange() final
* Counter: Make SetMaxPeriod() final

After these cleanups, the only file that does not run cleanly is
cscore_raw_cv.h due to it not being standalone.
This commit is contained in:
Peter Johnson
2021-01-01 10:27:49 -08:00
committed by GitHub
parent d741101fe3
commit f5e0fc3e9a
49 changed files with 314 additions and 138 deletions

View File

@@ -30,18 +30,18 @@ class ComPtr {
}
template <typename T>
ComPtr(const ComPtr<T>& other) noexcept : m_ptr(other.m_ptr) {
ComPtr(const ComPtr<T>& other) noexcept : m_ptr(other.m_ptr) { // NOLINT
InternalAddRef();
}
template <typename T>
ComPtr(ComPtr<T>&& other) noexcept : m_ptr(other.m_ptr) {
ComPtr(ComPtr<T>&& other) noexcept : m_ptr(other.m_ptr) { // NOLINT
other.m_ptr = nullptr;
}
~ComPtr() noexcept { InternalRelease(); }
ComPtr& operator=(const ComPtr& other) noexcept {
ComPtr& operator=(const ComPtr& other) noexcept { // NOLINT
InternalCopy(other.m_ptr);
return *this;
}