Skip to content

Commit

Permalink
Update clang-format (pre-commit) (#2312)
Browse files Browse the repository at this point in the history
  • Loading branch information
louwers authored Apr 24, 2024
1 parent 3454fda commit 54a07f4
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Expand All @@ -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]

2 changes: 1 addition & 1 deletion include/mbgl/gl/buffer_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class BufferRef {
/// @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
Expand Down
2 changes: 1 addition & 1 deletion include/mbgl/util/scoped.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion include/mbgl/util/tileset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Tileset {
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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MapSnapshot {
PointForFn pointForFn,
LatLngForFn latLngForFn);

MapSnapshot(jni::JNIEnv&){};
MapSnapshot(jni::JNIEnv&) {};
MapSnapshot(float pixelRatio, PointForFn, LatLngForFn);
~MapSnapshot();

Expand Down
2 changes: 1 addition & 1 deletion platform/node/src/node_expression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class NodeExpression : public Nan::ObjectWrap {

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>&);
Expand Down
2 changes: 1 addition & 1 deletion src/mbgl/annotation/annotation_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions test/actor/actor.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(); }
};
Expand All @@ -162,7 +162,7 @@ TEST(Actor, SelfDestructionDoesntCrashWaitingReceivingThreads) {
// callback

struct TestActor {
TestActor(ActorRef<TestActor>){};
TestActor(ActorRef<TestActor>) {};

void callMeBack(std::function<void()> callback) { callback(); }
};
Expand Down Expand Up @@ -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; }

Expand Down

0 comments on commit 54a07f4

Please sign in to comment.