Skip to content

Commit eb6b637

Browse files
authored
GH-47500: [C++] Add QualifierAlignment to clang-format options (#47501)
Use the [QualifierAlignment](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#qualifieralignment) clang-format option to make our code style more uniform. * GitHub Issue: #47500 Authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
1 parent a0fcb50 commit eb6b637

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+213
-212
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ ColumnLimit: 90
2020
DerivePointerAlignment: false
2121
IncludeBlocks: Preserve
2222
IndentPPDirectives: AfterHash
23+
QualifierAlignment: Left

cpp/examples/parquet/low_level_api/encryption_reader_writer_all_crypto_options.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ void InteropTestReadEncryptedParquetFiles(std::string root_path) {
420420
for (unsigned example_id = 0; example_id < vector_of_decryption_configurations.size();
421421
++example_id) {
422422
PrintDecryptionConfiguration(example_id + 1);
423-
for (auto const& file : files_in_directory) {
423+
for (const auto& file : files_in_directory) {
424424
std::string exception_msg = "";
425425
if (!FileNameEndsWith(file, "parquet.encrypted")) // Skip non encrypted files
426426
continue;

cpp/src/arrow/array/builder_nested.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ template class BaseListViewBuilder<LargeListViewType>;
4848
// MapBuilder
4949

5050
MapBuilder::MapBuilder(MemoryPool* pool, const std::shared_ptr<ArrayBuilder>& key_builder,
51-
std::shared_ptr<ArrayBuilder> const& item_builder,
51+
const std::shared_ptr<ArrayBuilder>& item_builder,
5252
const std::shared_ptr<DataType>& type)
5353
: ArrayBuilder(pool), key_builder_(key_builder), item_builder_(item_builder) {
5454
auto map_type = internal::checked_cast<const MapType*>(type.get());

cpp/src/arrow/array/builder_nested.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class VarLengthListLikeBuilder : public ArrayBuilder {
5151
/// Use this constructor to incrementally build the value array along with offsets and
5252
/// null bitmap.
5353
VarLengthListLikeBuilder(MemoryPool* pool,
54-
std::shared_ptr<ArrayBuilder> const& value_builder,
54+
const std::shared_ptr<ArrayBuilder>& value_builder,
5555
const std::shared_ptr<DataType>& type,
5656
int64_t alignment = kDefaultBufferAlignment)
5757
: ArrayBuilder(pool, alignment),
@@ -60,7 +60,7 @@ class VarLengthListLikeBuilder : public ArrayBuilder {
6060
value_field_(type->field(0)->WithType(NULLPTR)) {}
6161

6262
VarLengthListLikeBuilder(MemoryPool* pool,
63-
std::shared_ptr<ArrayBuilder> const& value_builder,
63+
const std::shared_ptr<ArrayBuilder>& value_builder,
6464
int64_t alignment = kDefaultBufferAlignment)
6565
: VarLengthListLikeBuilder(pool, value_builder,
6666
std::make_shared<TYPE>(value_builder->type()),
@@ -647,13 +647,13 @@ class ARROW_EXPORT FixedSizeListBuilder : public ArrayBuilder {
647647
/// Use this constructor to define the built array's type explicitly. If value_builder
648648
/// has indeterminate type, this builder will also.
649649
FixedSizeListBuilder(MemoryPool* pool,
650-
std::shared_ptr<ArrayBuilder> const& value_builder,
650+
const std::shared_ptr<ArrayBuilder>& value_builder,
651651
int32_t list_size);
652652

653653
/// Use this constructor to infer the built array's type. If value_builder has
654654
/// indeterminate type, this builder will also.
655655
FixedSizeListBuilder(MemoryPool* pool,
656-
std::shared_ptr<ArrayBuilder> const& value_builder,
656+
const std::shared_ptr<ArrayBuilder>& value_builder,
657657
const std::shared_ptr<DataType>& type);
658658

659659
Status Resize(int64_t capacity) override;

cpp/src/arrow/compute/api_aggregate.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ExecContext;
4848
class ARROW_EXPORT ScalarAggregateOptions : public FunctionOptions {
4949
public:
5050
explicit ScalarAggregateOptions(bool skip_nulls = true, uint32_t min_count = 1);
51-
static constexpr char const kTypeName[] = "ScalarAggregateOptions";
51+
static constexpr const char kTypeName[] = "ScalarAggregateOptions";
5252
static ScalarAggregateOptions Defaults() { return ScalarAggregateOptions{}; }
5353

5454
/// If true (the default), null values are ignored. Otherwise, if any value is null,
@@ -72,7 +72,7 @@ class ARROW_EXPORT CountOptions : public FunctionOptions {
7272
ALL,
7373
};
7474
explicit CountOptions(CountMode mode = CountMode::ONLY_VALID);
75-
static constexpr char const kTypeName[] = "CountOptions";
75+
static constexpr const char kTypeName[] = "CountOptions";
7676
static CountOptions Defaults() { return CountOptions{}; }
7777

7878
CountMode mode;
@@ -85,7 +85,7 @@ class ARROW_EXPORT CountOptions : public FunctionOptions {
8585
class ARROW_EXPORT ModeOptions : public FunctionOptions {
8686
public:
8787
explicit ModeOptions(int64_t n = 1, bool skip_nulls = true, uint32_t min_count = 0);
88-
static constexpr char const kTypeName[] = "ModeOptions";
88+
static constexpr const char kTypeName[] = "ModeOptions";
8989
static ModeOptions Defaults() { return ModeOptions{}; }
9090

9191
int64_t n = 1;
@@ -103,7 +103,7 @@ class ARROW_EXPORT ModeOptions : public FunctionOptions {
103103
class ARROW_EXPORT VarianceOptions : public FunctionOptions {
104104
public:
105105
explicit VarianceOptions(int ddof = 0, bool skip_nulls = true, uint32_t min_count = 0);
106-
static constexpr char const kTypeName[] = "VarianceOptions";
106+
static constexpr const char kTypeName[] = "VarianceOptions";
107107
static VarianceOptions Defaults() { return VarianceOptions{}; }
108108

109109
int ddof = 0;
@@ -119,7 +119,7 @@ class ARROW_EXPORT SkewOptions : public FunctionOptions {
119119
public:
120120
explicit SkewOptions(bool skip_nulls = true, bool biased = true,
121121
uint32_t min_count = 0);
122-
static constexpr char const kTypeName[] = "SkewOptions";
122+
static constexpr const char kTypeName[] = "SkewOptions";
123123
static SkewOptions Defaults() { return SkewOptions{}; }
124124

125125
/// If true (the default), null values are ignored. Otherwise, if any value is null,
@@ -154,7 +154,7 @@ class ARROW_EXPORT QuantileOptions : public FunctionOptions {
154154
enum Interpolation interpolation = LINEAR,
155155
bool skip_nulls = true, uint32_t min_count = 0);
156156

157-
static constexpr char const kTypeName[] = "QuantileOptions";
157+
static constexpr const char kTypeName[] = "QuantileOptions";
158158
static QuantileOptions Defaults() { return QuantileOptions{}; }
159159

160160
/// probability level of quantile must be between 0 and 1 inclusive
@@ -178,7 +178,7 @@ class ARROW_EXPORT TDigestOptions : public FunctionOptions {
178178
explicit TDigestOptions(std::vector<double> q, uint32_t delta = 100,
179179
uint32_t buffer_size = 500, bool skip_nulls = true,
180180
uint32_t min_count = 0);
181-
static constexpr char const kTypeName[] = "TDigestOptions";
181+
static constexpr const char kTypeName[] = "TDigestOptions";
182182
static TDigestOptions Defaults() { return TDigestOptions{}; }
183183

184184
/// probability level of quantile must be between 0 and 1 inclusive
@@ -268,7 +268,7 @@ class ARROW_EXPORT PivotWiderOptions : public FunctionOptions {
268268
UnexpectedKeyBehavior unexpected_key_behavior = kIgnore);
269269
// Default constructor for serialization
270270
PivotWiderOptions();
271-
static constexpr char const kTypeName[] = "PivotWiderOptions";
271+
static constexpr const char kTypeName[] = "PivotWiderOptions";
272272
static PivotWiderOptions Defaults() { return PivotWiderOptions{}; }
273273

274274
/// The values expected in the pivot key column
@@ -283,7 +283,7 @@ class ARROW_EXPORT IndexOptions : public FunctionOptions {
283283
explicit IndexOptions(std::shared_ptr<Scalar> value);
284284
// Default constructor for serialization
285285
IndexOptions();
286-
static constexpr char const kTypeName[] = "IndexOptions";
286+
static constexpr const char kTypeName[] = "IndexOptions";
287287

288288
std::shared_ptr<Scalar> value;
289289
};

0 commit comments

Comments
 (0)