Finish making clang-tidy (mostly) work (again) and run -fix (#2312)

This does some more work to the run_clang_tidy.py wrapper script, and runs an example pass.

"again" because it's really the proto fuzzer changes that broke it, it had been working before.

"mostly" because there's still an issue within the proto fuzzer that it can't find "port/protobuf.h", i.e. https://github.com/google/libprotobuf-mutator/tree/master/port, but I'm still hesitant to add an include path there.
This commit is contained in:
Jon Ross-Perkins
2022-10-18 15:48:17 -07:00
committed by GitHub
parent 561e45033e
commit 4d522c8e90
31 changed files with 176 additions and 141 deletions
+5 -3
View File
@@ -19,7 +19,7 @@ namespace {
// an annotated range.
class Annotations {
public:
Annotations(llvm::StringRef annotated_source) {
explicit Annotations(llvm::StringRef annotated_source) {
size_t index = annotated_source.find("$[[");
if (index == llvm::StringRef::npos) {
source_code_ = std::string(annotated_source);
@@ -39,11 +39,13 @@ class Annotations {
}
// Returns a view into the unannotated source.
llvm::StringRef source() const { return source_code_; }
auto source() const -> llvm::StringRef { return source_code_; }
// Returns the offsets in the file representing the annotated range if they
// exist and `{0, std::numeric_limits<size_t>::max()}` otherwise.
std::pair<size_t, size_t> range() const { return std::pair(start_, end_); }
auto range() const -> std::pair<size_t, size_t> {
return std::pair(start_, end_);
}
private:
std::string source_code_;