-
Notifications
You must be signed in to change notification settings - Fork 97
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
Conversation
We may want to use the official(?) clang-format plugin https://github.com/pre-commit/mirrors-clang-format : diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index c13ad362..3cfd2924 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -39,12 +39,13 @@ 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]
- types_or: [c, c++]
+ types_or:
+ - c++
+ - c
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks: |
https://github.com/pocc/pre-commit-hooks doesn't work if |
@@ -477,7 +474,7 @@ class PostgresCopyTimestampFieldWriter : public PostgresCopyFieldWriter { | |||
return ADBC_STATUS_INVALID_ARGUMENT; | |||
} | |||
|
|||
if (value < std::numeric_limits<int64_t>::min() + kPostgresTimestampEpoch) { | |||
if (value < (std::numeric_limits<int64_t>::min)() + kPostgresTimestampEpoch) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for avoiding name conflict on Windows.
windef.h
defines min
macro. It conflicts with std::numeric_limits::min()
. If we use (std::numeric_limits::min)()
, we can avoid the min
macro expansion.
@@ -476,7 +476,7 @@ struct BindStream { | |||
return ADBC_STATUS_INVALID_ARGUMENT; | |||
} | |||
|
|||
if (val < std::numeric_limits<int64_t>::min() + kPostgresTimestampEpoch) { | |||
if (val < (std::numeric_limits<int64_t>::min)() + kPostgresTimestampEpoch) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Kou!
Fixes #1461.