MS-575 Add Clang-format & Clang-tidy & Cpplint

Former-commit-id: 1a941a50fcdeaa0193be5c6d0031781bc3775d1e
This commit is contained in:
test 2019-10-09 06:00:30 +00:00
parent e43d93fc40
commit 406fc339cc
11 changed files with 20 additions and 20 deletions

View File

@ -76,7 +76,7 @@ ConvertToDataset(std::vector<SPTAG::QueryResult> query_results) {
auto p_id = (int64_t*)malloc(sizeof(int64_t) * elems);
auto p_dist = (float*)malloc(sizeof(float) * elems);
// TODO: throw if malloc failed.
// TODO: throw if malloc failed.
#pragma omp parallel for
for (auto i = 0; i < query_results.size(); ++i) {

View File

@ -36,7 +36,7 @@ struct BufferDeleter {
free((void*)buffer->data());
}
};
}
} // namespace internal
inline BufferPtr
MakeBufferSmart(uint8_t* data, const int64_t size) {

View File

@ -43,9 +43,9 @@ namespace kn = knowhere;
} // namespace
using ::testing::Combine;
using ::testing::TestWithParam;
using ::testing::Values;
using ::testing::Combine;
constexpr int device_id = 0;
constexpr int64_t DIM = 128;

View File

@ -34,9 +34,9 @@ namespace kn = knowhere;
} // namespace
using ::testing::Combine;
using ::testing::TestWithParam;
using ::testing::Values;
using ::testing::Combine;
class KDTTest : public DataGen, public ::testing::Test {
protected:

View File

@ -32,9 +32,9 @@ namespace kn = knowhere;
} // namespace
using ::testing::Combine;
using ::testing::TestWithParam;
using ::testing::Values;
using ::testing::Combine;
constexpr int64_t DEVICE_ID = 1;

View File

@ -55,9 +55,9 @@ MemTableFile::CreateTableFile() {
Status
MemTableFile::Add(const VectorSourcePtr& source, IDNumbers& vector_ids) {
if (table_file_schema_.dimension_ <= 0) {
std::string err_msg = "MemTableFile::Add: table_file_schema dimension = " +
std::to_string(table_file_schema_.dimension_) + ", table_id = " +
table_file_schema_.table_id_;
std::string err_msg =
"MemTableFile::Add: table_file_schema dimension = " + std::to_string(table_file_schema_.dimension_) +
", table_id = " + table_file_schema_.table_id_;
ENGINE_LOG_ERROR << err_msg;
return Status(DB_ERROR, "Not able to create table file");
}

View File

@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
#include "HybridPass.h"
#include "cpp/src/scheduler/optimizer/HybridPass.h"
#include "scheduler/task/SearchTask.h"
namespace milvus {
@ -30,6 +30,6 @@ HybridPass::Run(const TaskPtr& task) {
return false;
}
}
}
} // namespace scheduler
} // namespace milvus

View File

@ -43,6 +43,6 @@ class HybridPass : public Pass {
using HybridPassPtr = std::shared_ptr<HybridPass>;
}
}
} // namespace scheduler
} // namespace milvus

View File

@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
#include "Optimizer.h"
#include "cpp/src/scheduler/optimizer/Optimizer.h"
namespace milvus {
namespace scheduler {
@ -38,6 +38,6 @@ Optimizer::Run(const TaskPtr& task) {
return false;
}
}
}
} // namespace scheduler
} // namespace milvus

View File

@ -46,6 +46,6 @@ class Optimizer {
std::vector<PassPtr> pass_list_;
};
}
}
} // namespace scheduler
} // namespace milvus

View File

@ -42,5 +42,5 @@ class Pass {
};
using PassPtr = std::shared_ptr<Pass>;
}
}
} // namespace scheduler
} // namespace milvus