Update clang-format (pre-commit) (#2312)

This commit is contained in:
Bart Louwers
2024-04-24 06:56:10 +02:00
committed by GitHub
parent 3454fda628
commit 54a07f4b9c
9 changed files with 14 additions and 13 deletions

View File

@@ -5,7 +5,7 @@ repos:
- id: check-yaml
args: [--allow-multiple-documents]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.3
rev: v18.1.4
hooks:
- id: clang-format
files: '.*\.(hpp|cpp|h)'
@@ -21,4 +21,5 @@ repos:
additional_dependencies: [shellcheck-py]
ci:
# sometimes fails https://github.com/keith/pre-commit-buildifier/issues/13
skip: [buildifier]
skip: [buildifier]

View File

@@ -38,7 +38,7 @@ private:
/// @brief IBufferAllocator hides the underlying implementation of the buffer allocator scheme used.
class IBufferAllocator {
public:
virtual ~IBufferAllocator(){};
virtual ~IBufferAllocator() {};
/// @brief Write data into a buffer managed by the allocator
/// @param data Pointer to data to write into the buffer

View File

@@ -6,7 +6,7 @@ namespace mbgl {
template <typename Func>
struct Scoped {
Scoped(Func&& fn)
: cb(std::move(fn)){};
: cb(std::move(fn)) {};
~Scoped() { cb(); }
Scoped(const Scoped&) = delete;

View File

@@ -40,7 +40,7 @@ public:
zoomRange(zoomRange_),
attribution(std::move(attribution_)),
scheme(scheme_),
encoding(encoding_){};
encoding(encoding_) {};
// TileJSON also includes center and zoom but they are not used by mbgl.

View File

@@ -20,7 +20,7 @@ class HTTPFileSource::Impl {
public:
Impl(const ResourceOptions resourceOptions_, const ClientOptions clientOptions_)
: resourceOptions(resourceOptions_.clone()),
clientOptions(clientOptions_.clone()){};
clientOptions(clientOptions_.clone()) {};
android::UniqueEnv env{android::AttachEnv()};

View File

@@ -30,7 +30,7 @@ public:
PointForFn pointForFn,
LatLngForFn latLngForFn);
MapSnapshot(jni::JNIEnv&){};
MapSnapshot(jni::JNIEnv&) {};
MapSnapshot(float pixelRatio, PointForFn, LatLngForFn);
~MapSnapshot();

View File

@@ -21,7 +21,7 @@ public:
private:
NodeExpression(std::unique_ptr<mbgl::style::expression::Expression> expression_)
: expression(std::move(expression_)){};
: expression(std::move(expression_)) {};
static void New(const Nan::FunctionCallbackInfo<v8::Value>&);
static void Parse(const Nan::FunctionCallbackInfo<v8::Value>&);

View File

@@ -37,7 +37,7 @@ const std::string AnnotationManager::PointLayerID = "com.mapbox.annotations.poin
const std::string AnnotationManager::ShapeLayerID = "com.mapbox.annotations.shape.";
AnnotationManager::AnnotationManager(Style& style_)
: style(style_){};
: style(style_) {};
AnnotationManager::~AnnotationManager() = default;

View File

@@ -27,7 +27,7 @@ TEST(Actor, Construction) {
TEST(Actor, Destruction) {
struct TestActor {
TestActor(ActorRef<TestActor>, bool& destructed_)
: destructed(destructed_){};
: destructed(destructed_) {};
~TestActor() { destructed = true; }
bool& destructed;
@@ -136,7 +136,7 @@ TEST(Actor, DestructionAllowedInReceiveOnSameThread) {
// allows for self-closing actors
struct TestActor {
TestActor(ActorRef<TestActor>){};
TestActor(ActorRef<TestActor>) {};
void callMeBack(std::function<void()> callback) { callback(); }
};
@@ -162,7 +162,7 @@ TEST(Actor, SelfDestructionDoesntCrashWaitingReceivingThreads) {
// callback
struct TestActor {
TestActor(ActorRef<TestActor>){};
TestActor(ActorRef<TestActor>) {};
void callMeBack(std::function<void()> callback) { callback(); }
};
@@ -334,7 +334,7 @@ TEST(Actor, TwoPhaseConstruction) {
struct TestActor {
TestActor(ActorRef<TestActor>, std::shared_ptr<bool> destroyed_)
: destroyed(std::move(destroyed_)){};
: destroyed(std::move(destroyed_)) {};
~TestActor() { *destroyed = true; }