This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new f8510f03f4 chore: remove pre-commit scripts (#10463)
f8510f03f4 is described below

commit f8510f03f4c1f700b385cbf8c7c42994be72a0cb
Author: Jeffrey Vo <[email protected]>
AuthorDate: Tue Aug 4 02:41:54 2026 +0900

    chore: remove pre-commit scripts (#10463)
    
    I'm curious if anyone actually used these 🤔
    
    - `.pre-commit-config.yaml` is significantly outdated (references cmake
    and docker formatting?)
    - `pre-commit.sh` probably still works? but it apparently runs cargo fmt
    via nightly which we dont really want?
---
 .pre-commit-config.yaml | 69 ---------------------------------------
 CONTRIBUTING.md         | 25 --------------
 pre-commit.sh           | 86 -------------------------------------------------
 3 files changed, 180 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
deleted file mode 100644
index 5331a5313c..0000000000
--- a/.pre-commit-config.yaml
+++ /dev/null
@@ -1,69 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# To use this, install the python package `pre-commit` and
-# run once `pre-commit install`. This will setup a git pre-commit-hook
-# that is executed on each commit and will report the linting problems.
-# To run all hooks on all files use `pre-commit run -a`
-
-repos:
-  - repo: local
-    hooks:
-      - id: rat
-        name: Release Audit Tool
-        language: system
-        entry: bash -c "git archive HEAD --prefix=apache-arrow/ 
--output=arrow-src.tar && ./dev/release/run-rat.sh arrow-src.tar"
-        always_run: true
-        pass_filenames: false
-      - id: rustfmt
-        name: Rust Format
-        language: system
-        entry: bash -c "cargo +stable fmt --all -- --check"
-        files: ^.*\.rs$
-        types:
-          - file
-          - rust
-      - id: cmake-format
-        name: CMake Format
-        language: python
-        entry: python run-cmake-format.py
-        types: [cmake]
-        additional_dependencies:
-          - cmake_format==0.5.2
-      - id: hadolint
-        name: Docker Format
-        language: docker_image
-        types:
-         - dockerfile
-        entry: --entrypoint /bin/hadolint hadolint/hadolint:latest -
-        exclude: ^dev/.*$
-  - repo: git://github.com/pre-commit/pre-commit-hooks
-    sha: v1.2.3
-    hooks:
-     - id: flake8
-       name: Python Format
-       files: ^(python|dev|integration)/
-       types:
-         - file
-         - python
-     - id: flake8
-       name: Cython Format
-       files: ^python/
-       types:
-         - file
-         - cython
-       args: [--config=python/.flake8.cython]
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 48075c5ef7..c2d57f20ca 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -232,31 +232,6 @@ If you need to add new benchmarks to cover your change, 
make a separate PR first
 
 [#9729]: https://github.com/apache/arrow-rs/pull/9729
 
-## Git Pre-Commit Hook
-
-We can use [git pre-commit 
hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) to automate 
various kinds of git pre-commit checking/formatting.
-
-Suppose you are in the root directory of the project.
-
-First check if the file already exists:
-
-```bash
-ls -l .git/hooks/pre-commit
-```
-
-If the file already exists, to avoid mistakenly **overriding**, you MAY have 
to check
-the link source or file content. Else if not exist, let's safely soft link 
[pre-commit.sh](pre-commit.sh) as file `.git/hooks/pre-commit`:
-
-```bash
-ln -s  ../../pre-commit.sh .git/hooks/pre-commit
-```
-
-If sometimes you want to commit without checking, just run `git commit` with 
`--no-verify`:
-
-```bash
-git commit --no-verify -m "... commit message ..."
-```
-
 ## AI Generated Submissions
 
 This project follows the guidance for AI generated submissions used by the
diff --git a/pre-commit.sh b/pre-commit.sh
deleted file mode 100755
index f82390e229..0000000000
--- a/pre-commit.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# This file is git pre-commit hook.
-#
-# Soft link it as git hook under top dir of apache arrow git repository:
-# $ ln -s  ../../pre-commit.sh .git/hooks/pre-commit
-#
-# This file be run directly:
-# $ ./pre-commit.sh
-
-function RED() {
-       echo "\033[0;31m$@\033[0m"
-}
-
-function GREEN() {
-       echo "\033[0;32m$@\033[0m"
-}
-
-function BYELLOW() {
-       echo "\033[1;33m$@\033[0m"
-}
-
-# env GIT_DIR is set by git when run a pre-commit hook.
-if [ -z "${GIT_DIR}" ]; then
-       GIT_DIR=$(git rev-parse --show-toplevel)
-fi
-
-cd ${GIT_DIR}
-
-NUM_CHANGES=$(git diff --cached --name-only . |
-       grep -e ".*/*.rs$" |
-       awk '{print $1}' |
-       wc -l)
-
-if [ ${NUM_CHANGES} -eq 0 ]; then
-       echo -e "$(GREEN INFO): no staged changes in *.rs, $(GREEN skip cargo 
fmt/clippy)"
-       exit 0
-fi
-
-# 1. cargo clippy
-
-echo -e "$(GREEN INFO): cargo clippy ..."
-
-# Cargo clippy always return exit code 0, and `tee` doesn't work.
-# So let's just run cargo clippy.
-cargo clippy
-echo -e "$(GREEN INFO): cargo clippy done"
-
-# 2. cargo fmt: format with nightly and stable.
-
-CHANGED_BY_CARGO_FMT=false
-echo -e "$(GREEN INFO): cargo fmt with nightly and stable ..."
-
-for version in nightly stable; do
-       CMD="cargo +${version} fmt"
-       ${CMD} --all -q -- --check 2>/dev/null
-       if [ $? -ne 0 ]; then
-               ${CMD} --all
-               echo -e "$(BYELLOW WARN): ${CMD} changed some files"
-               CHANGED_BY_CARGO_FMT=true
-       fi
-done
-
-if ${CHANGED_BY_CARGO_FMT}; then
-       echo -e "$(RED FAIL): git commit $(RED ABORTED), please have a look and 
run git add/commit again"
-       exit 1
-fi
-
-exit 0

Reply via email to