Skip to content

Commit e88423c

Browse files
committed
fix(format): add clang-format to check all c++ files and fix exist format problem
1 parent 7bad8ec commit e88423c

10 files changed

Lines changed: 7329 additions & 8307 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ repos:
3939
rev: v21.1.2
4040
hooks:
4141
- id: clang-format
42-
files: ^python/
42+
files: \.(cc|cpp|h|hpp)$
4343
types_or: [c++]
4444
args: [--style=file, --verbose]
4545

cpp/src/graphar/filesystem.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ Result<T> FileSystem::ReadFileToValue(const std::string& path) const noexcept {
215215
}
216216

217217
template <>
218-
Result<std::string> FileSystem::ReadFileToValue(const std::string& path) const
219-
noexcept {
218+
Result<std::string> FileSystem::ReadFileToValue(
219+
const std::string& path) const noexcept {
220220
GAR_RETURN_ON_ARROW_ERROR_AND_ASSIGN(auto access_file,
221221
arrow_fs_->OpenInputFile(path));
222222
GAR_RETURN_ON_ARROW_ERROR_AND_ASSIGN(auto bytes, access_file->GetSize());
@@ -293,8 +293,8 @@ Status FileSystem::WriteTableToFile(
293293
}
294294

295295
Status FileSystem::WriteLabelTableToFile(
296-
const std::shared_ptr<arrow::Table>& table, const std::string& path) const
297-
noexcept {
296+
const std::shared_ptr<arrow::Table>& table,
297+
const std::string& path) const noexcept {
298298
// try to create the directory, oss filesystem may not support this, ignore
299299
ARROW_UNUSED(arrow_fs_->CreateDir(path.substr(0, path.find_last_of("/"))));
300300
GAR_RETURN_ON_ARROW_ERROR_AND_ASSIGN(auto output_stream,
@@ -398,7 +398,6 @@ Status FinalizeS3() {
398398
template Result<IdType> FileSystem::ReadFileToValue<IdType>(
399399
const std::string&) const noexcept;
400400
/// template specialization for std::string
401-
template Status FileSystem::WriteValueToFile<IdType>(const IdType&,
402-
const std::string&) const
403-
noexcept;
401+
template Status FileSystem::WriteValueToFile<IdType>(
402+
const IdType&, const std::string&) const noexcept;
404403
} // namespace graphar

cpp/src/graphar/filesystem.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ class FileSystem {
104104
* @return A Status indicating OK if successful, or an error if unsuccessful.
105105
*/
106106
template <typename T>
107-
Status WriteValueToFile(const T& value, const std::string& path) const
108-
noexcept;
107+
Status WriteValueToFile(const T& value,
108+
const std::string& path) const noexcept;
109109

110110
/**
111111
* @brief Write a table to a file with a specific type.
@@ -115,10 +115,10 @@ class FileSystem {
115115
* @param options Options for writing the table, such as compression.
116116
* @return A Status indicating OK if successful, or an error if unsuccessful.
117117
*/
118-
Status WriteTableToFile(const std::shared_ptr<arrow::Table>& table,
119-
FileType file_type, const std::string& path,
120-
const std::shared_ptr<WriterOptions>& options) const
121-
noexcept;
118+
Status WriteTableToFile(
119+
const std::shared_ptr<arrow::Table>& table, FileType file_type,
120+
const std::string& path,
121+
const std::shared_ptr<WriterOptions>& options) const noexcept;
122122

123123
/**
124124
* @brief Write a label table to a file with parquet type.

0 commit comments

Comments
 (0)