From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 8544C469719 for ; Fri, 30 Oct 2020 14:44:08 +0300 (MSK) From: Kirill Yukhin Date: Fri, 30 Oct 2020 14:43:47 +0300 Message-Id: Subject: [Tarantool-patches] [PATCH 0/5] Add clang format List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Hello, This patchset introduces Clang formatter rules and applies them to the src/box/ sources (except for sql/). Diff consists of about 6.000 insertions which is about 5% of code base. Is also adds new rules to cmake: - make format-set, to apply Clang formatter - make format-check, to check if current format is OK Finally it adds a new job to gitlab CI's first stage which fails of Clang format is not OK. I've prepared corresponding changes for other release branches and intend to commit all changes together. Issue https://github.com/tarantool/tarantool/issues/4297 Branch https://github.com/tarantool/tarantool/tree/kyukhin/gh-4297-clang-format-master CI https://gitlab.com/tarantool/tarantool/-/pipelines/209689550 Kirill Yukhin (5): clang-format: guard various declarations Add .clang-format for src/box/ build: add clang-format rules gitlab-ci: add code style check Apply Clang formatter .gitlab-ci.yml | 7 + .travis.mk | 6 +- CMakeLists.txt | 38 +- src/box/.clang-format | 125 ++++ src/box/alter.cc | 1494 +++++++++++++++++++++-------------------- src/box/applier.cc | 140 ++-- src/box/applier.h | 36 +- src/box/authentication.cc | 8 +- src/box/authentication.h | 1 - src/box/bind.c | 13 +- src/box/bind.h | 3 +- src/box/blackhole.c | 15 +- src/box/box.cc | 192 +++--- src/box/box.h | 98 ++- src/box/call.c | 9 +- src/box/checkpoint_schedule.c | 4 +- src/box/checkpoint_schedule.h | 4 +- src/box/ck_constraint.c | 17 +- src/box/ck_constraint.h | 4 +- src/box/coll_id.c | 2 +- src/box/coll_id_cache.c | 9 +- src/box/coll_id_def.c | 17 +- src/box/column_mask.h | 8 +- src/box/constraint_id.c | 8 +- src/box/engine.c | 56 +- src/box/engine.h | 84 ++- src/box/errcode.c | 11 +- src/box/errcode.h | 4 +- src/box/error.cc | 78 ++- src/box/error.h | 86 +-- src/box/execute.c | 98 ++- src/box/field_def.c | 28 +- src/box/field_def.h | 2 +- src/box/field_map.c | 13 +- src/box/field_map.h | 15 +- src/box/fk_constraint.h | 5 +- src/box/func.c | 58 +- src/box/func.h | 3 +- src/box/func_def.c | 4 +- src/box/func_def.h | 4 +- src/box/gc.c | 38 +- src/box/ibuf.c | 3 +- src/box/identifier.c | 6 +- src/box/index.cc | 118 ++-- src/box/index.h | 135 ++-- src/box/index_def.c | 47 +- src/box/index_def.h | 22 +- src/box/iproto.cc | 213 +++--- src/box/iproto_constants.c | 4 + src/box/iproto_constants.h | 26 +- src/box/iterator_type.c | 3 +- src/box/iterator_type.h | 29 +- src/box/journal.c | 6 +- src/box/journal.h | 23 +- src/box/key_def.c | 130 ++-- src/box/key_def.h | 62 +- src/box/key_list.c | 8 +- src/box/key_list.h | 4 +- src/box/lua/call.c | 104 ++- src/box/lua/call.h | 8 +- src/box/lua/cfg.cc | 88 ++- src/box/lua/console.c | 112 +-- src/box/lua/ctl.c | 14 +- src/box/lua/error.cc | 35 +- src/box/lua/execute.c | 55 +- src/box/lua/index.c | 75 ++- src/box/lua/info.c | 85 +-- src/box/lua/init.c | 108 ++- src/box/lua/key_def.c | 51 +- src/box/lua/merger.c | 181 ++--- src/box/lua/misc.cc | 37 +- src/box/lua/net_box.c | 97 +-- src/box/lua/sequence.c | 12 +- src/box/lua/serialize_lua.c | 197 +++--- src/box/lua/session.c | 68 +- src/box/lua/slab.c | 17 +- src/box/lua/slab.h | 3 +- src/box/lua/space.cc | 80 +-- src/box/lua/stat.c | 36 +- src/box/lua/stat.h | 3 +- src/box/lua/tuple.c | 98 +-- src/box/lua/xlog.c | 38 +- src/box/memtx_bitset.c | 72 +- src/box/memtx_engine.c | 101 ++- src/box/memtx_engine.h | 18 +- src/box/memtx_hash.c | 143 ++-- src/box/memtx_rtree.c | 58 +- src/box/memtx_space.c | 178 ++--- src/box/memtx_space.h | 4 +- src/box/memtx_tree.cc | 377 ++++++----- src/box/memtx_tx.c | 141 ++-- src/box/memtx_tx.h | 4 +- src/box/merger.c | 9 +- src/box/mp_error.cc | 80 +-- src/box/msgpack.c | 4 +- src/box/opt_def.c | 10 +- src/box/opt_def.h | 72 +- src/box/port.h | 6 +- src/box/raft.c | 31 +- src/box/recovery.cc | 40 +- src/box/recovery.h | 2 +- src/box/relay.cc | 71 +- src/box/relay.h | 2 +- src/box/replication.cc | 121 ++-- src/box/replication.h | 11 +- src/box/request.c | 15 +- src/box/schema.cc | 159 +++-- src/box/schema.h | 17 +- src/box/schema_def.c | 6 +- src/box/schema_def.h | 6 +- src/box/sequence.c | 50 +- src/box/session.cc | 38 +- src/box/session.h | 9 +- src/box/session_settings.c | 34 +- src/box/space.c | 80 +-- src/box/space.h | 87 ++- src/box/space_def.c | 30 +- src/box/space_def.h | 16 +- src/box/sysview.c | 44 +- src/box/tuple.c | 99 +-- src/box/tuple.h | 32 +- src/box/tuple_bloom.c | 27 +- src/box/tuple_bloom.h | 5 +- src/box/tuple_compare.cc | 401 ++++++----- src/box/tuple_convert.c | 28 +- src/box/tuple_dictionary.c | 37 +- src/box/tuple_extract_key.cc | 82 ++- src/box/tuple_format.c | 189 +++--- src/box/tuple_format.h | 34 +- src/box/tuple_hash.cc | 140 ++-- src/box/txn.c | 66 +- src/box/txn_limbo.c | 34 +- src/box/user.cc | 101 ++- src/box/user.h | 5 +- src/box/user_def.c | 23 +- src/box/user_def.h | 6 +- src/box/vclock.c | 151 ++--- src/box/vclock.h | 24 +- src/box/vinyl.c | 363 +++++----- src/box/vinyl.h | 12 +- src/box/vy_cache.c | 60 +- src/box/vy_cache.h | 10 +- src/box/vy_history.c | 8 +- src/box/vy_history.h | 7 +- src/box/vy_log.c | 213 +++--- src/box/vy_log.h | 52 +- src/box/vy_lsm.c | 157 +++-- src/box/vy_lsm.h | 18 +- src/box/vy_mem.c | 92 +-- src/box/vy_mem.h | 13 +- src/box/vy_point_lookup.c | 42 +- src/box/vy_point_lookup.h | 4 +- src/box/vy_quota.c | 13 +- src/box/vy_quota.h | 7 +- src/box/vy_range.c | 19 +- src/box/vy_range.h | 4 +- src/box/vy_read_iterator.c | 132 ++-- src/box/vy_read_set.c | 11 +- src/box/vy_regulator.c | 41 +- src/box/vy_regulator.h | 7 +- src/box/vy_run.c | 367 +++++----- src/box/vy_run.h | 48 +- src/box/vy_scheduler.c | 179 ++--- src/box/vy_scheduler.h | 6 +- src/box/vy_stmt.c | 114 ++-- src/box/vy_stmt.h | 85 +-- src/box/vy_stmt_stream.h | 10 +- src/box/vy_tx.c | 127 ++-- src/box/vy_tx.h | 21 +- src/box/vy_upsert.c | 17 +- src/box/vy_upsert.h | 4 +- src/box/vy_write_iterator.c | 64 +- src/box/vy_write_iterator.h | 11 +- src/box/wal.c | 183 +++-- src/box/wal.h | 8 +- src/box/xlog.c | 288 ++++---- src/box/xlog.h | 36 +- src/box/xrow.c | 347 +++++----- src/box/xrow.h | 44 +- src/box/xrow_io.cc | 16 +- src/box/xrow_io.h | 1 - src/box/xrow_update.c | 11 +- src/box/xrow_update.h | 5 +- src/box/xrow_update_array.c | 66 +- src/box/xrow_update_bar.c | 75 +-- src/box/xrow_update_field.c | 106 +-- src/box/xrow_update_field.h | 132 ++-- src/box/xrow_update_map.c | 74 +- src/box/xrow_update_route.c | 45 +- 189 files changed, 6445 insertions(+), 6246 deletions(-) create mode 100644 src/box/.clang-format -- 1.8.3.1