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

@@ -65,12 +65,11 @@ bool GetJpegSize(wpi::StringRef data, int* width, int* height) {
}
data = data.substr(2); // Get to the first block
auto bytes = data.bytes_begin();
for (;;) {
if (data.size() < 4) {
return false; // EOF
}
bytes = data.bytes_begin();
auto bytes = data.bytes_begin();
if (bytes[0] != 0xff) {
return false; // not a tag
}
@@ -104,12 +103,11 @@ bool JpegNeedsDHT(const char* data, size_t* size, size_t* locSOF) {
// Search until SOS for DHT tag
sdata = sdata.substr(2); // Get to the first block
auto bytes = sdata.bytes_begin();
for (;;) {
if (sdata.size() < 4) {
return false; // EOF
}
bytes = sdata.bytes_begin();
auto bytes = sdata.bytes_begin();
if (bytes[0] != 0xff) {
return false; // not a tag
}