Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): remove invalid --version=14 clang-format argument #1462

Merged
merged 3 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ repos:
files: '\.(bat|sln)$'
- id: trailing-whitespace
exclude: "^r/.*?/_snaps/.*?.md$"
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v14.0.6"
hooks:
- id: clang-format
args: [-i, --version=14]
types_or: [c, c++]
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
Expand Down
15 changes: 1 addition & 14 deletions c/driver/postgresql/copy/postgres_copy_reader_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include <gtest/gtest.h>
#include <nanoarrow/nanoarrow.hpp>

#include "postgresql/copy/reader.h"
#include "postgres_copy_test_common.h"
#include "postgresql/copy/reader.h"

namespace adbcpq {

Expand Down Expand Up @@ -53,7 +53,6 @@ class PostgresCopyStreamTester {
PostgresCopyStreamReader reader_;
};


TEST(PostgresCopyUtilsTest, PostgresCopyReadBoolean) {
ArrowBufferView data;
data.data.as_uint8 = kTestPgCopyBoolean;
Expand Down Expand Up @@ -91,7 +90,6 @@ TEST(PostgresCopyUtilsTest, PostgresCopyReadBoolean) {
ASSERT_FALSE(ArrowBitGet(data_buffer, 2));
}


TEST(PostgresCopyUtilsTest, PostgresCopyReadSmallInt) {
ArrowBufferView data;
data.data.as_uint8 = kTestPgCopySmallInt;
Expand Down Expand Up @@ -130,7 +128,6 @@ TEST(PostgresCopyUtilsTest, PostgresCopyReadSmallInt) {
ASSERT_EQ(data_buffer[4], 0);
}


TEST(PostgresCopyUtilsTest, PostgresCopyReadInteger) {
ArrowBufferView data;
data.data.as_uint8 = kTestPgCopyInteger;
Expand Down Expand Up @@ -169,7 +166,6 @@ TEST(PostgresCopyUtilsTest, PostgresCopyReadInteger) {
ASSERT_EQ(data_buffer[4], 0);
}


TEST(PostgresCopyUtilsTest, PostgresCopyReadBigInt) {
ArrowBufferView data;
data.data.as_uint8 = kTestPgCopyBigInt;
Expand Down Expand Up @@ -208,7 +204,6 @@ TEST(PostgresCopyUtilsTest, PostgresCopyReadBigInt) {
ASSERT_EQ(data_buffer[4], 0);
}


TEST(PostgresCopyUtilsTest, PostgresCopyReadReal) {
ArrowBufferView data;
data.data.as_uint8 = kTestPgCopyReal;
Expand Down Expand Up @@ -247,7 +242,6 @@ TEST(PostgresCopyUtilsTest, PostgresCopyReadReal) {
ASSERT_EQ(data_buffer[4], 0);
}


TEST(PostgresCopyUtilsTest, PostgresCopyReadDoublePrecision) {
ArrowBufferView data;
data.data.as_uint8 = kTestPgCopyDoublePrecision;
Expand Down Expand Up @@ -287,7 +281,6 @@ TEST(PostgresCopyUtilsTest, PostgresCopyReadDoublePrecision) {
ASSERT_EQ(data_buffer[4], 0);
}


TEST(PostgresCopyUtilsTest, PostgresCopyReadDate) {
ArrowBufferView data;
data.data.as_uint8 = kTestPgCopyDate;
Expand Down Expand Up @@ -321,7 +314,6 @@ TEST(PostgresCopyUtilsTest, PostgresCopyReadDate) {
ASSERT_EQ(data_buffer[1], 47482);
}


// For full coverage, ensure that this contains NUMERIC examples that:
// - Have >= four zeroes to the left of the decimal point
// - Have >= four zeroes to the right of the decimal point
Expand Down Expand Up @@ -404,7 +396,6 @@ TEST(PostgresCopyUtilsTest, PostgresCopyReadNumeric) {
EXPECT_EQ(std::string(item.data, item.size_bytes), "inf");
}


TEST(PostgresCopyUtilsTest, PostgresCopyReadTimestamp) {
ArrowBufferView data;
data.data.as_uint8 = kTestPgCopyTimestamp;
Expand Down Expand Up @@ -438,7 +429,6 @@ TEST(PostgresCopyUtilsTest, PostgresCopyReadTimestamp) {
ASSERT_EQ(data_buffer[1], 4102490096000000);
}


TEST(PostgresCopyUtilsTest, PostgresCopyReadInterval) {
ArrowBufferView data;
data.data.as_uint8 = kTestPgCopyInterval;
Expand Down Expand Up @@ -486,7 +476,6 @@ TEST(PostgresCopyUtilsTest, PostgresCopyReadInterval) {
ASSERT_EQ(interval.ns, 4000000000);
}


TEST(PostgresCopyUtilsTest, PostgresCopyReadText) {
ArrowBufferView data;
data.data.as_uint8 = kTestPgCopyText;
Expand Down Expand Up @@ -526,7 +515,6 @@ TEST(PostgresCopyUtilsTest, PostgresCopyReadText) {
ASSERT_EQ(std::string(data_buffer + 3, 4), "1234");
}


TEST(PostgresCopyUtilsTest, PostgresCopyReadBinary) {
ArrowBufferView data;
data.data.as_uint8 = kTestPgCopyBinary;
Expand Down Expand Up @@ -576,7 +564,6 @@ TEST(PostgresCopyUtilsTest, PostgresCopyReadBinary) {
ASSERT_EQ(data_buffer[7], 0xff);
}


// COPY (SELECT CAST("col" AS INTEGER ARRAY) AS "col" FROM ( VALUES ('{-123, -1}'), ('{0,
// 1, 123}'), (NULL)) AS drvd("col")) TO STDOUT WITH (FORMAT binary);
static uint8_t kTestPgCopyIntegerArray[] = {
Expand Down
42 changes: 19 additions & 23 deletions c/driver/postgresql/copy/postgres_copy_test_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ static uint8_t kTestPgCopyBoolean[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};


// COPY (SELECT CAST("col" AS SMALLINT) AS "col" FROM ( VALUES (-123), (-1), (1), (123),
// (NULL)) AS drvd("col")) TO STDOUT WITH (FORMAT binary);
static uint8_t kTestPgCopySmallInt[] = {
Expand All @@ -47,7 +46,6 @@ static uint8_t kTestPgCopyInteger[] = {
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00,
0x00, 0x00, 0x7b, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};


// COPY (SELECT CAST("col" AS BIGINT) AS "col" FROM ( VALUES (-123), (-1), (1), (123),
// (NULL)) AS drvd("col")) TO STDOUT WITH (FORMAT binary);
static uint8_t kTestPgCopyBigInt[] = {
Expand Down Expand Up @@ -78,29 +76,28 @@ static uint8_t kTestPgCopyDoublePrecision[] = {
0x2f, 0x1a, 0x9f, 0xbe, 0x77, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

static uint8_t kTestPgCopyDate[] = {
0x50, 0x47, 0x43, 0x4f, 0x50, 0x59, 0x0a, 0xff, 0x0d, 0x0a, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xff, 0xff,
0x71, 0x54, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x8e, 0xad, 0x00, 0x01,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
0x50, 0x47, 0x43, 0x4f, 0x50, 0x59, 0x0a, 0xff, 0x0d, 0x0a, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x04, 0xff, 0xff, 0x71, 0x54, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00,
0x00, 0x8e, 0xad, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

// COPY (SELECT CAST(col AS TIMESTAMP) FROM ( VALUES ('1900-01-01 12:34:56'),
// ('2100-01-01 12:34:56'), (NULL)) AS drvd("col")) TO STDOUT WITH (FORMAT BINARY);
static uint8_t kTestPgCopyTimestamp[] = {
0x50, 0x47, 0x43, 0x4f, 0x50, 0x59, 0x0a, 0xff, 0x0d, 0x0a, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x08, 0xff, 0xf4, 0xc9, 0xf9, 0x07, 0xe5, 0x9c, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0b, 0x36, 0x30, 0x2d, 0xa5,
0xfc, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
0x50, 0x47, 0x43, 0x4f, 0x50, 0x59, 0x0a, 0xff, 0x0d, 0x0a, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0xff, 0xf4, 0xc9,
0xf9, 0x07, 0xe5, 0x9c, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0b, 0x36,
0x30, 0x2d, 0xa5, 0xfc, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

// COPY (SELECT CAST(col AS INTERVAL) FROM ( VALUES ('-1 months -2 days -4 seconds'),
// ('1 months 2 days 4 seconds'), (NULL)) AS drvd("col")) TO STDOUT WITH (FORMAT BINARY);
static uint8_t kTestPgCopyInterval[] = {
0x50, 0x47, 0x43, 0x4f, 0x50, 0x59, 0x0a, 0xff, 0x0d, 0x0a, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0xff,
0xff, 0xff, 0xff, 0xff, 0xc2, 0xf7, 0x00, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff,
0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, 0x09,
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff};
0x50, 0x47, 0x43, 0x4f, 0x50, 0x59, 0x0a, 0xff, 0x0d, 0x0a, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc2, 0xf7, 0x00, 0xff, 0xff, 0xff,
0xfe, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x3d, 0x09, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x01, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

// COPY (SELECT CAST("col" AS TEXT) AS "col" FROM ( VALUES ('abc'), ('1234'),
// (NULL::text)) AS drvd("col")) TO STDOUT WITH (FORMAT binary);
Expand All @@ -114,11 +111,10 @@ static uint8_t kTestPgCopyText[] = {
// ('\x01020304'), ('\xFEFF'), (NULL)) AS drvd("col")) TO STDOUT
// WITH (FORMAT binary);
static uint8_t kTestPgCopyBinary[] = {
0x50, 0x47, 0x43, 0x4f, 0x50, 0x59, 0x0a, 0xff, 0x0d, 0x0a, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04,
0x01, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0xfe, 0xff,
0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

0x50, 0x47, 0x43, 0x4f, 0x50, 0x59, 0x0a, 0xff, 0x0d, 0x0a, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00,
0x00, 0x00, 0x04, 0x01, 0x02, 0x03, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00,
0x02, 0xfe, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

} // namespace adbcpq
Loading
Loading