Skip to content

Commit

Permalink
chore: update all pre-commit hooks (#1787)
Browse files Browse the repository at this point in the history
Fixes #1678.
  • Loading branch information
lidavidm authored Apr 29, 2024
1 parent 9afc04c commit ae3825f
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 24 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ jobs:
shell: bash -l {0}
run: |
docker compose up --detach flightsql-test flightsql-sqlite-test dremio dremio-init
cat .env | grep -v -e '^#' | awk NF | tee -a $GITHUB_ENV
pip install python-dotenv[cli]
python -m dotenv -f .env list --format simple | tee -a $GITHUB_ENV
- name: Build FlightSQL Driver
shell: bash -l {0}
Expand Down Expand Up @@ -229,7 +230,8 @@ jobs:
- name: Configure Integration Env Vars
shell: bash -l {0}
run: |
cat .env | grep -v -e '^#' | awk NF | tee -a $GITHUB_ENV
pip install python-dotenv[cli]
python -m dotenv -f .env list --format simple | tee -a $GITHUB_ENV
echo "ADBC_USE_ASAN=ON" >> $GITHUB_ENV
echo "ADBC_USE_UBSAN=ON" >> $GITHUB_ENV
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/native-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,8 @@ jobs:
- name: Configure Integration Env Vars
shell: bash -l {0}
run: |
cat .env | grep -v -e '^#' | awk NF | tee -a $GITHUB_ENV
pip install python-dotenv[cli]
python -m dotenv -f .env list --format simple | tee -a $GITHUB_ENV
- name: Test Recipes (C++)
shell: bash -l {0}
run: |
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.6.0
hooks:
- id: check-xml
- id: check-yaml
Expand All @@ -40,7 +40,7 @@ repos:
- id: trailing-whitespace
exclude: "^r/.*?/_snaps/.*?.md$"
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v14.0.6"
rev: "v18.1.4"
hooks:
- id: clang-format
types_or: [c, c++]
Expand All @@ -59,30 +59,30 @@ repos:
- "--linelength=90"
- "--verbose=2"
- repo: https://github.com/golangci/golangci-lint
rev: v1.57.1
rev: v1.57.2
hooks:
- id: golangci-lint
entry: bash -c 'cd go/adbc && golangci-lint run --fix --timeout 5m'
types_or: [go]
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.12.0
rev: v2.13.0
hooks:
- id: pretty-format-golang
- id: pretty-format-java
args: [--autofix]
types_or: [java]
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 24.4.2
hooks:
- id: black
types_or: [pyi, python]
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 7.0.0
hooks:
- id: flake8
types_or: [python]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
types_or: [python]
Expand Down
8 changes: 2 additions & 6 deletions c/validation/adbc_validation_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,8 @@ struct GetObjectsReader {
}
~GetObjectsReader() { AdbcGetObjectsDataDelete(get_objects_data_); }

struct AdbcGetObjectsData* operator*() {
return get_objects_data_;
}
struct AdbcGetObjectsData* operator->() {
return get_objects_data_;
}
struct AdbcGetObjectsData* operator*() { return get_objects_data_; }
struct AdbcGetObjectsData* operator->() { return get_objects_data_; }

private:
struct AdbcGetObjectsData* get_objects_data_;
Expand Down
3 changes: 1 addition & 2 deletions python/adbc_driver_manager/adbc_driver_manager/dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ def __exit__(self, exc_type, exc_val, exc_tb) -> None:
self.close()

@abc.abstractmethod
def close(self) -> None:
...
def close(self) -> None: ...


class _SharedDatabase(_Closeable):
Expand Down
2 changes: 1 addition & 1 deletion python/adbc_driver_manager/tests/test_lowlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_error_mapping():
]

message = "Message"
for (klass, code) in cases:
for klass, code in cases:
with pytest.raises(klass) as exc_info:
_lib._test_error(code, message, vendor_code=None, sqlstate=None)
assert message in exc_info.value.args[0]
Expand Down
3 changes: 1 addition & 2 deletions python/adbc_driver_postgresql/benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ def teardown(self, *args, **kwargs) -> None:
self.sqlalchemy_connection.close()

@abc.abstractmethod
def _make_table_name(self, *args, **kwargs) -> str:
...
def _make_table_name(self, *args, **kwargs) -> str: ...

def time_pandas_adbc(self, row_count: int, data_type: str) -> None:
with self.conn.cursor() as cursor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ def connect(
if uri is not None:
kwargs["uri"] = uri
appname = kwargs.get(DatabaseOptions.APPLICATION_NAME.value, "")
kwargs[
DatabaseOptions.APPLICATION_NAME.value
] = f"[ADBC][Python-{__version__}]{appname}"
kwargs[DatabaseOptions.APPLICATION_NAME.value] = (
f"[ADBC][Python-{__version__}]{appname}"
)
return adbc_driver_manager.AdbcDatabase(driver=_driver_path(), **kwargs)


Expand Down

0 comments on commit ae3825f

Please sign in to comment.