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

@@ -448,10 +448,10 @@ void DispatcherBase::ServerThreadMain() {
using namespace std::placeholders;
auto conn = std::make_shared<NetworkConnection>(
++m_connections_uid, std::move(stream), m_notifier, m_logger,
std::bind(&Dispatcher::ServerHandshake, this, _1, _2, _3),
std::bind(&IStorage::GetMessageEntryType, &m_storage, _1));
std::bind(&Dispatcher::ServerHandshake, this, _1, _2, _3), // NOLINT
std::bind(&IStorage::GetMessageEntryType, &m_storage, _1)); // NOLINT
conn->set_process_incoming(
std::bind(&IStorage::ProcessIncoming, &m_storage, _1, _2,
std::bind(&IStorage::ProcessIncoming, &m_storage, _1, _2, // NOLINT
std::weak_ptr<NetworkConnection>(conn)));
{
std::scoped_lock lock(m_user_mutex);
@@ -507,10 +507,10 @@ void DispatcherBase::ClientThreadMain() {
using namespace std::placeholders;
auto conn = std::make_shared<NetworkConnection>(
++m_connections_uid, std::move(stream), m_notifier, m_logger,
std::bind(&Dispatcher::ClientHandshake, this, _1, _2, _3),
std::bind(&IStorage::GetMessageEntryType, &m_storage, _1));
std::bind(&Dispatcher::ClientHandshake, this, _1, _2, _3), // NOLINT
std::bind(&IStorage::GetMessageEntryType, &m_storage, _1)); // NOLINT
conn->set_process_incoming(
std::bind(&IStorage::ProcessIncoming, &m_storage, _1, _2,
std::bind(&IStorage::ProcessIncoming, &m_storage, _1, _2, // NOLINT
std::weak_ptr<NetworkConnection>(conn)));
m_connections.resize(0); // disconnect any current
m_connections.emplace_back(conn);