From 20a59131ceaa21b95ae177b0f8fdc9f1756da434 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Fri, 31 Jan 2025 13:41:25 +0900 Subject: [PATCH 1/5] GH-45398: [CI][Dev][Ruby] Add Ruby lint --- .pre-commit-config.yaml | 12 ++++++++++++ .rubocop.yml | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .rubocop.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ee2e233bb19..8dcbeaece2ba 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -141,6 +141,18 @@ repos: ( ?^r/src/arrowExports\.cpp$| ) + - repo: https://github.com/rubocop/rubocop + rev: "v1.71.0" + hooks: + - id: rubocop + name: Ruby Format + alias: ruby-format + args: [--autocorrect] + exclude: >- + ( + ?^dev/tasks/homebrew-formulae/.*\.rb$| + ) + files: .*\.rb$ - repo: https://github.com/cheshirekow/cmake-format-precommit rev: v0.6.13 hooks: diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 000000000000..dedcc33cf456 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,16 @@ +# Ruby lint begins minimal. +# All of checkings changed to disable by default. +AllCops: + DisabledByDefault: true + +Lint: + Enabled: false + +# The recommendation width are 80 characters. +# Due to some codes over the limitation(80 characters), +# apply the relax value. +Layout/LineLength: + Max: 100 + +Layout/ArgumentAlignment: + Enabled: true From 13156fc8c248cb3b6cd890a520257ecef78d7cff Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Mon, 3 Feb 2025 12:18:54 +0900 Subject: [PATCH 2/5] GH-45398: [CI][Dev][Ruby] Add Ruby lint --- .rubocop.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index dedcc33cf456..a9721fcc1779 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,20 @@ +# 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. + # Ruby lint begins minimal. # All of checkings changed to disable by default. AllCops: From 08b0be5e357791cf32f3692ac9333a944b5425a1 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Mon, 3 Feb 2025 15:06:22 +0900 Subject: [PATCH 3/5] Update .pre-commit-config.yaml Co-authored-by: Sutou Kouhei --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8dcbeaece2ba..225bcba683fe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -147,7 +147,8 @@ repos: - id: rubocop name: Ruby Format alias: ruby-format - args: [--autocorrect] + args: + - "--autocorrect" exclude: >- ( ?^dev/tasks/homebrew-formulae/.*\.rb$| From 1c8ec89486e2ecda8987c58af342f03cba68c1ce Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Mon, 3 Feb 2025 15:06:32 +0900 Subject: [PATCH 4/5] Update .rubocop.yml Co-authored-by: Sutou Kouhei --- .rubocop.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index a9721fcc1779..0f4f4847e190 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -23,9 +23,6 @@ AllCops: Lint: Enabled: false -# The recommendation width are 80 characters. -# Due to some codes over the limitation(80 characters), -# apply the relax value. Layout/LineLength: Max: 100 From ff07bd564bc40696ae29c6a35e4f1f7d695b7e35 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Mon, 3 Feb 2025 16:44:56 +0900 Subject: [PATCH 5/5] GH-45398: [CI][Dev][Ruby] Add Ruby lint --- .pre-commit-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 225bcba683fe..e386b87be6e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -153,7 +153,6 @@ repos: ( ?^dev/tasks/homebrew-formulae/.*\.rb$| ) - files: .*\.rb$ - repo: https://github.com/cheshirekow/cmake-format-precommit rev: v0.6.13 hooks: