Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

Commit d487a89

Browse files
committed
Dumped llvm clang format
1 parent f5ff54a commit d487a89

File tree

5 files changed

+23
-27
lines changed

5 files changed

+23
-27
lines changed

.clang-format

+4-6
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,10 @@ PenaltyBreakString: 1000
9090
PenaltyExcessCharacter: 1000000
9191
PenaltyReturnTypeOnItsOwnLine: 60
9292
PointerAlignment: Right
93-
RawStringFormats:
94-
- Language: TextProto
95-
Delimiters:
96-
- 'pb'
97-
- 'proto'
98-
BasedOnStyle: google
93+
RawStringFormats:
94+
- Delimiter: pb
95+
Language: TextProto
96+
BasedOnStyle: google
9997
ReflowComments: true
10098
SortIncludes: true
10199
SortUsingDeclarations: true

clang-format.bash

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
find ./include ./src ./samples -type f \( -iname \*.cpp -o -iname \*.hpp \) | xargs clang-format -style=file -i

include/cppgit2/exception.hpp

+15-17
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,19 @@
55

66
namespace cppgit2 {
77

8-
class exception : public std::exception {
9-
public:
10-
exception() {
11-
auto error = git_error_last();
12-
message_ = error ? error->message : "unknown error";
13-
}
14-
exception(const char * message) : message_(message) {}
15-
exception(const std::string & message) : message_(message) {}
16-
virtual ~exception() throw() {}
17-
virtual const char * what() const throw() {
18-
return message_.c_str();
19-
}
8+
class exception : public std::exception {
9+
public:
10+
exception() {
11+
auto error = git_error_last();
12+
message_ = error ? error->message : "unknown error";
13+
}
14+
exception(const char *message) : message_(message) {}
15+
exception(const std::string &message) : message_(message) {}
16+
virtual ~exception() throw() {}
17+
virtual const char *what() const throw() { return message_.c_str(); }
2018

21-
protected:
22-
std::string message_;
23-
};
24-
25-
}
19+
protected:
20+
std::string message_;
21+
};
22+
23+
} // namespace cppgit2

include/cppgit2/oid.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
2+
#include <cppgit2/exception.hpp>
23
#include <git2.h>
34
#include <string>
4-
#include <cppgit2/exception.hpp>
55

66
namespace cppgit2 {
77

src/oid.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
using namespace cppgit2;
44

5-
oid::oid() {
6-
git_libgit2_init();
7-
}
5+
oid::oid() { git_libgit2_init(); }
86

97
oid::oid(const std::string &hex_string) {
108
git_libgit2_init();

0 commit comments

Comments
 (0)