Unverified Commit 283cdde4 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[ci] add shellcheck, use latest pre-commit hook versions (#6685)

parent 98936155
...@@ -13,7 +13,7 @@ exclude: | ...@@ -13,7 +13,7 @@ exclude: |
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0 rev: v5.0.0
hooks: hooks:
- id: end-of-file-fixer - id: end-of-file-fixer
- id: trailing-whitespace - id: trailing-whitespace
...@@ -25,7 +25,7 @@ repos: ...@@ -25,7 +25,7 @@ repos:
args: ["--settings-path", "python-package/pyproject.toml"] args: ["--settings-path", "python-package/pyproject.toml"]
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version. # Ruff version.
rev: v0.5.7 rev: v0.7.0
hooks: hooks:
# Run the linter. # Run the linter.
- id: ruff - id: ruff
...@@ -35,3 +35,7 @@ repos: ...@@ -35,3 +35,7 @@ repos:
- id: ruff-format - id: ruff-format
args: ["--config", "python-package/pyproject.toml"] args: ["--config", "python-package/pyproject.toml"]
types_or: [python, jupyter] types_or: [python, jupyter]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
...@@ -876,8 +876,7 @@ def _load_pandas_categorical( ...@@ -876,8 +876,7 @@ def _load_pandas_categorical(
max_offset = -getsize(file_name) max_offset = -getsize(file_name)
with open(file_name, "rb") as f: with open(file_name, "rb") as f:
while True: while True:
if offset < max_offset: offset = max(offset, max_offset)
offset = max_offset
f.seek(offset, SEEK_END) f.seek(offset, SEEK_END)
lines = f.readlines() lines = f.readlines()
if len(lines) >= 2: if len(lines) >= 2:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment