From 4e5db98128ada904d26b5e99980bbc32d07da749 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Wed, 25 Jun 2025 11:24:41 +1000 Subject: [PATCH] pre-commit add rubocop with one rule spaces for indentation https://docs.rubocop.org/rubocop/integration_with_other_tools.html#git-pre-commit-hook-integration-with-pre-commit --- .github/linters/.rubocop.yml | 7 +++++++ .pre-commit-config.yaml | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 .github/linters/.rubocop.yml diff --git a/.github/linters/.rubocop.yml b/.github/linters/.rubocop.yml new file mode 100644 index 000000000..9eeb6d8cc --- /dev/null +++ b/.github/linters/.rubocop.yml @@ -0,0 +1,7 @@ +AllCops: + DisabledByDefault: true + TargetRubyVersion: 3.4.0 + +Layout/IndentationStyle: + Enabled: true + EnforcedStyle: spaces diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b819bf3b..51bb0489d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -115,6 +115,14 @@ repos: args: [--config=.github/linters/mlc_config.json, -q] types: [markdown] files: \.md$ + - repo: https://github.com/rubocop/rubocop + rev: v1.77.0 + hooks: + - id: rubocop + name: run rubocop + description: RuboCop is a Ruby code style checker (linter) and formatter based on the community-driven Ruby Style Guide + exclude: ^test/t/syntax\.rb$ + args: [--config=.github/linters/.rubocop.yml] - repo: https://github.com/shellcheck-py/shellcheck-py rev: v0.10.0.1 hooks: