Skip to content

Apache Lucene open-source search software

build: integrate prek (#15629)

Robert Muir68e90db82280
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 959c9c7f473..7215ddd4d0f 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -26,6 +26,18 @@ updates:
cooldown:
default-days: 7
+ # python dependencies in /dev-tools
+ - package-ecosystem: uv
+ directory: /dev-tools/
+ open-pull-requests-limit: 25
+ schedule:
+ interval: monthly
+ commit-message:
+ prefix: build(deps)
+ labels: [dependencies, skip-changelog]
+ cooldown:
+ default-days: 7
+
- package-ecosystem: gradle
directory: /
open-pull-requests-limit: 25
diff --git a/.github/problem-matchers/actionlint-matcher.json b/.github/problem-matchers/actionlint-matcher.json
new file mode 100644
index 00000000000..4613e1617bf
--- /dev/null
+++ b/.github/problem-matchers/actionlint-matcher.json
@@ -0,0 +1,17 @@
+{
+ "problemMatcher": [
+ {
+ "owner": "actionlint",
+ "pattern": [
+ {
+ "regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
+ "file": 1,
+ "line": 2,
+ "column": 3,
+ "message": 4,
+ "code": 5
+ }
+ ]
+ }
+ ]
+}
diff --git a/.github/problem-matchers/ruff-check.json b/.github/problem-matchers/ruff-check.json
new file mode 100644
index 00000000000..82447b03122
--- /dev/null
+++ b/.github/problem-matchers/ruff-check.json
@@ -0,0 +1,17 @@
+{
+ "problemMatcher": [
+ {
+ "owner": "ruff-check",
+ "pattern": [
+ {
+ "code": 4,
+ "column": 3,
+ "file": 1,
+ "line": 2,
+ "message": 5,
+ "regexp": "^Error: (.*):(\\d+):(\\d+): (\\w+) (.*)$"
+ }
+ ]
+ }
+ ]
+}
diff --git a/.github/problem-matchers/ruff-format.json b/.github/problem-matchers/ruff-format.json
new file mode 100644
index 00000000000..291306f63f1
--- /dev/null
+++ b/.github/problem-matchers/ruff-format.json
@@ -0,0 +1,20 @@
+{
+ "problemMatcher": [
+ {
+ "owner": "ruff-format",
+ "pattern": [
+ {
+ "code": 2,
+ "column": 5,
+ "endColumn": 7,
+ "endLine": 6,
+ "file": 3,
+ "line": 4,
+ "message": 8,
+ "regexp": "^(?:(error|warning|notice))\\s+title=([^,]+),file=([^,]+),line=(\\d+),col=(\\d+)(?:,endLine=(\\d+))?(?:,endColumn=(\\d+))?::(.+)$",
+ "severity": 1
+ }
+ ]
+ }
+ ]
+}
diff --git a/.github/problem-matchers/shellcheck-gcc.json b/.github/problem-matchers/shellcheck-gcc.json
new file mode 100644
index 00000000000..cf58ce42bd4
--- /dev/null
+++ b/.github/problem-matchers/shellcheck-gcc.json
@@ -0,0 +1,18 @@
+{
+ "problemMatcher": [
+ {
+ "owner": "shellcheck-gcc",
+ "pattern": [
+ {
+ "regexp": "^(.+):(\\d+):(\\d+):\\s(note|warning|error):\\s(.*)\\s\\[(SC\\d+)\\]$",
+ "file": 1,
+ "line": 2,
+ "column": 3,
+ "severity": 4,
+ "message": 5,
+ "code": 6
+ }
+ ]
+ }
+ ]
+}
diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml
index f58b24f97b7..7dd4bfbf211 100644
--- a/.github/workflows/actions.yml
+++ b/.github/workflows/actions.yml
@@ -1,35 +1,14 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
-name: Validate Actions
+name: Validate Actions (online checks)
on:
workflow_dispatch:
- pull_request:
- paths:
- - '.github/**'
- push:
- branches:
- - main
- paths:
- - '.github/**'
schedule:
- cron: '22 2 * * *'
permissions: {}
jobs:
- actionlint:
- name: Run actionlint
- runs-on: ubuntu-latest
- timeout-minutes: 15
- steps:
- - name: Checkout repository
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- with:
- persist-credentials: false
- - name: Install the latest version of uv
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
- - name: Check workflows with actionlint
- run: uvx --from actionlint-py actionlint -color
zizmor:
name: Run zizmor
runs-on: ubuntu-latest
@@ -47,8 +26,6 @@ jobs:
run: uvx zizmor --pedantic --format=sarif . > results.sarif
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- # run offline for branches and PRs to avoid rate limits
- ZIZMOR_OFFLINE: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
with:
diff --git a/.github/workflows/run-checks-all.yml b/.github/workflows/run-checks-all.yml
index 0a5abd9296d..6939814d163 100644
--- a/.github/workflows/run-checks-all.yml
+++ b/.github/workflows/run-checks-all.yml
@@ -25,11 +25,47 @@ env:
# the other runs all tests without other validation checks.
jobs:
+ # Fast repository check
+ lint:
+ name: lint repository
+ runs-on: ubuntu-slim
+ timeout-minutes: 15
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+ with:
+ persist-credentials: false
+
+ - name: Configure problem matchers
+ run: |
+ echo "::add-matcher::.github/problem-matchers/actionlint-matcher.json"
+ echo "::add-matcher::.github/problem-matchers/ruff-check.json"
+ echo "::add-matcher::.github/problem-matchers/ruff-format.json"
+ echo "::add-matcher::.github/problem-matchers/shellcheck-gcc.json"
+
+ - name: Setup uv
+ uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
+ with:
+ version: "0.9.27"
+ enable-cache: true
+ prune-cache: false
+ save-cache: ${{ github.event_name != 'pull_request' }}
+ cache-dependency-glob: dev-tools/uv.lock
+ cache-suffix: dev-tools
+
+ - name: Run prek
+ run: uv run prek --all-files --show-diff-on-failure
+ env:
+ UV_PROJECT: dev-tools
+ UV_FROZEN: "1"
+
# This runs all validation checks without tests.
checks:
name: checks without tests (JDK ${{ matrix.java }} on ${{ matrix.os }})
timeout-minutes: 15
+ needs: lint
strategy:
matrix:
@@ -54,12 +90,6 @@ jobs:
if: ${{ ! startsWith(matrix.os, 'windows') }}
uses: ./.github/actions/eclint
- - name: Install ast-grep
- if: ${{ ! startsWith(matrix.os, 'windows') }}
- run: |
- npm -g i @ast-grep/cli
- echo "lucene.tool.ast-grep=ast-grep" >> build-options.local.properties
-
- name: Run gradle check (without tests)
run: ./gradlew check -x test "-Ptask.times=true"
@@ -68,6 +98,7 @@ jobs:
tests:
name: tests (JDK ${{ matrix.java }} on ${{ matrix.os }})
timeout-minutes: 30
+ needs: lint
strategy:
matrix:
diff --git a/.pre-commit-config.yml b/.pre-commit-config.yml
new file mode 100644
index 00000000000..d5028cc05fb
--- /dev/null
+++ b/.pre-commit-config.yml
@@ -0,0 +1,273 @@
+---
+# yaml-language-server: $schema=https://raw.githubusercontent.com/j178/prek/refs/heads/master/prek.schema.json
+minimum_prek_version: 0.2.29
+default_install_hook_types:
+ - pre-commit
+default_stages:
+ - pre-commit
+# define priority: 0 for linters that don't modify sources
+# leave fixers with priority: null so they run sequentially
+repos:
+ # "Built-in Fast Hooks" from prek.
+ - repo: builtin
+ hooks:
+ - id: check-added-large-files
+ name: Check for large files
+ priority: 0
+
+ - id: check-case-conflict
+ name: Check for files that would conflict in case-insensitive filesystems
+ priority: 0
+
+ - id: trailing-whitespace
+ name: Fix trailing whitespace
+ types: [ text ]
+ # TODO: fix these files
+ exclude:
+ glob:
+ - lucene/demo/src/test/org/apache/lucene/demo/test-files/docs/*.txt
+ - lucene/analysis/common/src/resources/org/apache/lucene/analysis/**/stopwords.txt
+ - lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.java
+ - lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/checkcompoundrep.aff
+
+ - id: end-of-file-fixer
+ name: Fix newline at EOF
+ # TODO: fix these files
+ exclude:
+ glob:
+ - .dir-locals.el
+ - .github/actionlint.yaml
+ - dev-tools/scripts/README.md
+ - gradle/documentation/render-javadoc/custom_styles.css
+ - help/*.txt
+ - LICENSE.txt
+ - lucene/analysis/common/src/java/org/apache/lucene/analysis/email/ASCIITLD.jflex
+ - lucene/analysis/common/src/resources/org/apache/lucene/analysis/bn/stopwords.txt
+ - lucene/analysis/common/src/resources/org/apache/lucene/analysis/snowball/*.txt
+ - lucene/analysis/common/src/test/org/apache/lucene/analysis/charfilter/*.htm
+ - lucene/analysis/common/src/test/org/apache/lucene/analysis/email/*.{txt,html}
+ - lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/*.{aff,dic}
+ - lucene/analysis/common/src/test/org/apache/lucene/analysis/no/*.txt
+ - lucene/analysis/common/src/test/org/apache/lucene/analysis/synonym/synonyms.txt
+ - lucene/analysis/icu/src/data/utr30/*.txt
+ - lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/*.rbbi
+ - lucene/benchmark/conf/*.alg
+ - lucene/demo/src/test/org/apache/lucene/demo/test-files/docs/*.txt
+ - lucene/distribution/src/binary-release/README.md
+ - lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/CambridgeMA.utf8
+ - lucene/licenses/*.txt
+ - lucene/misc/src/java/org/apache/lucene/misc/doc-files/*.svg
+ - lucene/test-framework/src/resources/org/apache/lucene/tests/index/LICENSE.txt
+ - lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj
+ - versions.lock
+
+ - id: fix-byte-order-marker
+ name: Fix UTF-8 byte order marker
+
+ - id: check-json
+ name: Check JSON files
+ priority: 0
+ types: [ json ]
+
+ - id: check-toml
+ name: Check TOML files
+ priority: 0
+ types: [ toml ]
+
+ - id: check-yaml
+ name: Check YAML files
+ priority: 0
+ types: [ yaml ]
+ args: [ --allow-multiple-documents ]
+
+ - id: check-xml
+ name: Check XML files
+ priority: 0
+ types: [ xml ]
+
+ - id: mixed-line-ending
+ name: Fix line endings
+ types: [ text ]
+
+ - id: check-merge-conflict
+ name: Check for merge conflicts
+ priority: 0
+
+ - id: detect-private-key
+ name: Check for private keys
+ priority: 0
+
+ - id: check-executables-have-shebangs
+ name: Check that (non-binary) executables have a shebang
+ priority: 0
+ exclude:
+ glob:
+ # TODO: fix these permissions
+ - lucene/analysis/common/**/*.java
+ - lucene/codecs/**/*.java
+ - lucene/queries/**/*.java
+ - lucene/spatial3d/**/*.java
+
+ - repo: local
+ hooks:
+ - id: shellcheck
+ name: Check Shell Scripts
+ priority: 0
+ language: system
+ entry: uv
+ args: [ 'run', 'shellcheck', '--format', 'gcc' ]
+ env:
+ UV_PROJECT: dev-tools
+ UV_FROZEN: "1"
+ types: [ shell ]
+ exclude:
+ glob:
+ # TODO: fix these shell scripts
+ - dev-tools/test-patch/*.sh
+ - gradle/regenerate/snowball/snowball.sh
+ - gradlew
+ - lucene/distribution/src/binary-release/bin/luke.sh
+
+ - id: actionlint
+ name: Check Github Actions
+ priority: 0
+ language: system
+ entry: uv
+ args: [ 'run', 'actionlint' ]
+ env:
+ UV_PROJECT: dev-tools
+ UV_FROZEN: "1"
+ # run across all actions if any are touched
+ pass_filenames: false
+ files:
+ glob:
+ - .github/**/*.yml
+
+ - id: zizmor
+ name: Check Github Actions Security
+ priority: 0
+ language: system
+ entry: uv
+ args: [ 'run', 'zizmor', '--pedantic', '--offline', '.' ]
+ env:
+ UV_PROJECT: dev-tools
+ UV_FROZEN: "1"
+ # run across all actions if any are touched
+ pass_filenames: false
+ files:
+ glob:
+ - .github/**/*.yml
+
+ - id: rumdl
+ name: Fix Markdown
+ language: system
+ entry: uv
+ args: [ 'run', 'rumdl', 'fmt' ]
+ env:
+ UV_PROJECT: dev-tools
+ UV_FROZEN: "1"
+ types: [ 'markdown']
+ require_serial: true
+ exclude:
+ glob:
+ # TODO: fix formatting of these files separately
+ - .github/PULL_REQUEST_TEMPLATE.md
+ - CONTRIBUTING.md
+ - dev-docs/file-formats.md
+ - dev-docs/github-issues-howto.md
+ - dev-tools/aws-jmh/README.md
+ - dev-tools/scripts/README.md
+ - lucene/backward-codecs/README.md
+ - lucene/distribution/src/binary-release/README.md
+ - lucene/luke/README.md
+ - lucene/luke/src/distribution/README.md
+ - lucene/MIGRATE.md
+ - lucene/SYSTEM_REQUIREMENTS.md
+ - README.md
+
+ - id: ruff-check
+ name: Fix Python
+ language: system
+ entry: uv
+ args: [ 'run', 'ruff', 'check', '--fix', '--force-exclude' ]
+ env:
+ UV_PROJECT: dev-tools
+ UV_FROZEN: "1"
+ types_or: [ python, pyi, jupyter ]
+ require_serial: true
+ exclude:
+ glob:
+ # TODO: fix the issues with these files separately
+ - gradle/regenerate/jflex/htmlentity.py
+ - gradle/regenerate/packed/gen_BulkOperation.py
+ - gradle/regenerate/moman/createLevAutomata.py
+ - lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/**/{gen_ForUtil.py,gen_ForDeltaUtil.py}
+ - lucene/core/src/java/org/apache/lucene/codecs/**/gen_ForUtil.py
+ - lucene/core/src/java/org/apache/lucene/util/automaton/UTF32ToUTF8.py
+ - lucene/core/src/java/org/apache/lucene/util/packed/gen_BulkOperation.py
+ - lucene/core/src/test/org/apache/lucene/util/makeEuroparlLineFile.py
+
+ - id: ruff-format
+ language: system
+ name: Fix Python formatting
+ entry: uv
+ args: [ 'run', 'ruff', 'format', '--force-exclude' ]
+ env:
+ UV_PROJECT: dev-tools
+ UV_FROZEN: "1"
+ types_or: [ python, pyi, jupyter ]
+ require_serial: true
+ exclude:
+ glob:
+ # TODO: fix the formatting of these files separately
+ - gradle/regenerate/jflex/htmlentity.py
+ - gradle/regenerate/moman/createLevAutomata.py
+ - gradle/regenerate/packed/{gen_BulkOperation.py,gen_Packed64SingleBlock.py}
+ - lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/**/{gen_ForUtil.py,gen_ForDeltaUtil.py}
+ - lucene/core/src/java/org/apache/lucene/codecs/**/gen_ForUtil.py
+ - lucene/core/src/java/org/apache/lucene/util/packed/{gen_BulkOperation.py,gen_Packed64SingleBlock.py}
+ - lucene/core/src/java/org/apache/lucene/util/automaton/UTF32ToUTF8.py
+ - lucene/core/src/test/org/apache/lucene/util/makeEuroparlLineFile.py
+
+ - id: test-ast-grep
+ name: Check ast-grep rules
+ priority: 0
+ language: system
+ entry: uv
+ args: [ 'run', 'ast-grep', '-c', './gradle/validation/ast-grep/sgconfig.yml', 'test', '--skip-snapshot-tests' ]
+ env:
+ UV_PROJECT: dev-tools
+ UV_FROZEN: "1"
+ # run across all rules if any are touched
+ pass_filenames: false
+ files:
+ glob:
+ - gradle/validation/ast-grep/**/*.yml
+
+ - id: ast-grep
+ name: Check Sources with ast-grep
+ priority: 0
+ language: system
+ entry: uv
+ args: [ 'run', 'ast-grep', '-c', './gradle/validation/ast-grep/sgconfig.yml', 'scan', '--format', 'github' ]
+ types_or: [ 'css', 'html', 'java', 'javascript', 'yaml']
+ require_serial: true
+ env:
+ UV_PROJECT: dev-tools
+ UV_FROZEN: "1"
+ # self-checks for this configuration file
+ - repo: meta
+ hooks:
+ - id: check-hooks-apply
+ name: Check prek hooks match at least one file
+ priority: 0
+ files:
+ glob:
+ .pre-commit-config.yml
+
+ - id: check-useless-excludes
+ name: Check prek excludes match include pattern
+ priority: 0
+ files:
+ glob:
+ .pre-commit-config.yml
diff --git a/.rumdl.toml b/.rumdl.toml
new file mode 100644
index 00000000000..3bd7cb1cd62
--- /dev/null
+++ b/.rumdl.toml
@@ -0,0 +1,5 @@
+[global]
+# disable line length checks to prevent annoyances
+line-length = 0
+# not really a markdown file, but a template
+exclude = [ "lucene/documentation/src/markdown/index.template.md" ]
diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/astgrep/AstGrepPlugin.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/astgrep/AstGrepPlugin.java
deleted file mode 100644
index 8f13fc23b25..00000000000
--- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/astgrep/AstGrepPlugin.java
+++ /dev/null
@@ -1,115 +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.
- */
-package org.apache.lucene.gradle.plugins.astgrep;
-
-import com.carrotsearch.gradle.buildinfra.buildoptions.BuildOptionsExtension;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.lucene.gradle.plugins.misc.QuietExec;
-import org.gradle.api.GradleException;
-import org.gradle.api.Plugin;
-import org.gradle.api.Project;
-import org.gradle.api.tasks.Exec;
-
-public class AstGrepPlugin implements Plugin<Project> {
- @Override
- public void apply(Project project) {
- if (project != project.getRootProject()) {
- throw new GradleException("This plugin can be applied to the root project only.");
- }
-
- var optionName = "lucene.tool.ast-grep";
- var tasks = project.getTasks();
-
- var astToolOption =
- project
- .getExtensions()
- .getByType(BuildOptionsExtension.class)
- .addOption(optionName, "External ast-grep executable (path or name)");
-
- var testAstGrepRules =
- tasks.register(
- "testAstGrepRules",
- QuietExec.class,
- (task) -> {
- task.setArgs(
- List.of(
- "test",
- "--skip-snapshot-tests",
- "-c",
- "gradle/validation/ast-grep/sgconfig.yml"));
- });
-
- var applyAstGrepRulesTask =
- tasks.register(
- "applyAstGrepRules",
- Exec.class,
- task -> {
- task.mustRunAfter(testAstGrepRules);
-
- if (!astToolOption.isPresent()) {
- task.getLogger()
- .warn(
- "The ast-grep tool location is not set ('{}' option), will not apply"
- + " ast-grep rules.",
- optionName);
- }
-
- var args = new ArrayList<String>();
- // fail on any rule match regardless of severity level. Scan hidden files/directories
- // too.
- args.addAll(
- List.of(
- "scan",
- "-c",
- "gradle/validation/ast-grep/sgconfig.yml",
- "--error",
- "--no-ignore",
- "hidden"));
- // use the github format when being run as a workflow
- if (System.getenv("CI") != null && System.getenv("GITHUB_WORKFLOW") != null) {
- args.addAll(List.of("--format", "github"));
- }
- task.setArgs(args);
- });
-
- // Common configuration.
- List.of(testAstGrepRules, applyAstGrepRulesTask)
- .forEach(
- taskProv -> {
- taskProv.configure(
- task -> {
- if (!astToolOption.isPresent()) {
- task.setEnabled(false);
- }
-
- if (astToolOption.isPresent()) {
- task.setExecutable(astToolOption.get());
- }
- task.setWorkingDir(project.getLayout().getProjectDirectory());
- });
- });
-
- tasks
- .matching(task -> task.getName().equals("check"))
- .configureEach(
- task -> {
- task.dependsOn(testAstGrepRules);
- task.dependsOn(applyAstGrepRulesTask);
- });
- }
-}
diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/licenses/CheckLicensesPlugin.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/licenses/CheckLicensesPlugin.java
index ed2bb102677..11d14497ac5 100644
--- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/licenses/CheckLicensesPlugin.java
+++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/licenses/CheckLicensesPlugin.java
@@ -95,6 +95,8 @@ public class CheckLicensesPlugin extends LuceneGradlePlugin {
".github/**",
".gitignore",
".lift.toml",
+ ".pre-commit-config.yml",
+ ".rumdl.toml",
".vscode/**",
"LICENSE.txt",
"NOTICE.txt",
diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/misc/HelpPlugin.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/misc/HelpPlugin.java
index 719432bdc52..f33986fdd99 100644
--- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/misc/HelpPlugin.java
+++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/misc/HelpPlugin.java
@@ -36,6 +36,7 @@ public class HelpPlugin extends LuceneGradlePlugin {
List.of(
new HelpFile("Workflow", "help/workflow.txt", "Typical workflow commands."),
new HelpFile("Tests", "help/tests.txt", "Tests, filtering, beasting, etc."),
+ new HelpFile("Precommit", "help/precommit.txt", "Precommit checks."),
new HelpFile("Formatting", "help/formatting.txt", "Code formatting conventions."),
new HelpFile("Jvms", "help/jvms.txt", "Using alternative or EA JVM toolchains."),
new HelpFile(
diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/misc/LuceneRootConfigurationPlugin.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/misc/LuceneRootConfigurationPlugin.java
index 5a8cec08a6d..a892a0874ad 100644
--- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/misc/LuceneRootConfigurationPlugin.java
+++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/misc/LuceneRootConfigurationPlugin.java
@@ -19,7 +19,6 @@ package org.apache.lucene.gradle.plugins.misc;
import com.carrotsearch.gradle.buildinfra.buildoptions.BuildOptionsPlugin;
import java.util.Collection;
import org.apache.lucene.gradle.plugins.LuceneGradlePlugin;
-import org.apache.lucene.gradle.plugins.astgrep.AstGrepPlugin;
import org.apache.lucene.gradle.plugins.documentation.DocumentationConfigPlugin;
import org.apache.lucene.gradle.plugins.eclint.EditorConfigLintPlugin;
import org.apache.lucene.gradle.plugins.gitgrep.GitGrepPlugin;
@@ -76,7 +75,6 @@ public class LuceneRootConfigurationPlugin extends LuceneGradlePlugin {
// Register more root-level plugins
plugins.apply(RegenerateTasksSupportPlugin.class);
plugins.apply(GitGrepPlugin.class);
- plugins.apply(AstGrepPlugin.class);
plugins.apply(EditorConfigLintPlugin.class);
plugins.apply(HelpPlugin.class);
plugins.apply(HacksPlugin.class);
diff --git a/dev-tools/pyproject.toml b/dev-tools/pyproject.toml
new file mode 100644
index 00000000000..8444684f6b5
--- /dev/null
+++ b/dev-tools/pyproject.toml
@@ -0,0 +1,24 @@
+[project]
+name = "dev-tools"
+description = "Developer tool support"
+version = "0.0.0"
+requires-python = ">=3.12"
+dependencies = []
+
+[dependency-groups]
+dev = [
+ # git hooks and repository checks
+ "prek==0.3.1",
+ # validates github actions
+ "zizmor==1.22.0",
+ # validates github actions
+ "actionlint-py==1.7.10.24",
+ # validates bash
+ "shellcheck-py==0.11.0.1",
+ # validates markdown
+ "rumdl==0.1.7",
+ # validates python
+ "ruff==0.14.14",
+ # validates various
+ "ast-grep-cli==0.40.5",
+]
diff --git a/dev-tools/uv.lock b/dev-tools/uv.lock
new file mode 100644
index 00000000000..937f84ca9c4
--- /dev/null
+++ b/dev-tools/uv.lock
@@ -0,0 +1,148 @@
+version = 1
+revision = 3
+requires-python = ">=3.12"
+
+[[package]]
+name = "actionlint-py"
+version = "1.7.10.24"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/9c/01/790379bf4cab91a272421a39b3d80f4a0d1a1ed753c00176be28b7d6adc6/actionlint_py-1.7.10.24.tar.gz", hash = "sha256:bac4e74e944c692fc7c65661009caebf14621bb33d937127ee5df8ac0693736a", size = 12057, upload-time = "2026-01-01T17:06:36.282Z" }
+
+[[package]]
+name = "ast-grep-cli"
+version = "0.40.5"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/63/1a/136b60ea7c2a5d813f1cb2e11f41c68cb8c1a0e594b48d16400b3f4f96a2/ast_grep_cli-0.40.5.tar.gz", hash = "sha256:30226f9461232cece568d9072b297cee94baeac7bbaefe31080e502bf64f6db8", size = 215734, upload-time = "2026-01-10T18:06:08.954Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/5b/de/0114c873ade9634a96bdd73d360fa8e7066ecacf46e73b7eabc363a980c7/ast_grep_cli-0.40.5-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:3c1d7a8efef7f3a86aa7451cfcd991db02f596ad90ca72044a5b6eb7209d3639", size = 14425525, upload-time = "2026-01-10T18:06:06.382Z" },
+ { url = "https://files.pythonhosted.org/packages/07/7b/93f13c7992105f00bf913cd45111b28366d8369d898916d2f47909eb1cf1/ast_grep_cli-0.40.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b9fd71d545708f2101212ce6c9e69abecd645702646665f9718d499179ff9f9e", size = 7214751, upload-time = "2026-01-10T18:06:14.926Z" },
+ { url = "https://files.pythonhosted.org/packages/46/76/6cf29923359d583150477d4929a88389283ec73f7ea592e66d247bd6edb9/ast_grep_cli-0.40.5-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:6ec8c0899cc0545353b311101227dca74014230160c01c1197b74b6c83c77833", size = 7058794, upload-time = "2026-01-10T18:06:10.29Z" },
+ { url = "https://files.pythonhosted.org/packages/61/39/004493cbc63fe5b3d7feb178ed99b3e285237cfb4bfcf8f1605cc3fa702d/ast_grep_cli-0.40.5-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:881ba2a43036f21464764978590712d5a1280f6f43880a6ff6cfa4538338e559", size = 7361701, upload-time = "2026-01-10T18:06:17.248Z" },
+ { url = "https://files.pythonhosted.org/packages/b3/f3/e411fd81d7ab7811a29d0f89ee5f81980a942fdeb298c3d67f373d1d7d55/ast_grep_cli-0.40.5-py3-none-win32.whl", hash = "sha256:cfc4c7c16c5f68d6f0d79bc128d6c7185c17887d75b94682458a890c3d8319e3", size = 6921853, upload-time = "2026-01-10T18:06:19.067Z" },
+ { url = "https://files.pythonhosted.org/packages/9c/8b/50d74a777b3617b4a2e17a471433c983822506bb7d077e18ee6d6dd263bb/ast_grep_cli-0.40.5-py3-none-win_amd64.whl", hash = "sha256:a2253c898384728393bf587a530b27f44ce8077e6a0bcd20fc2c07f89681620d", size = 7371484, upload-time = "2026-01-10T18:06:03.997Z" },
+ { url = "https://files.pythonhosted.org/packages/ba/b9/1d02935e30692d044205e4dca30367c4db16146836bbd25de5705992c3a1/ast_grep_cli-0.40.5-py3-none-win_arm64.whl", hash = "sha256:ba42cdf8148b58fb763ad20a3bb5e84d487141327f41fed5276d04e637194be6", size = 7083807, upload-time = "2026-01-10T18:06:12.76Z" },
+]
+
+[[package]]
+name = "dev-tools"
+version = "0.0.0"
+source = { virtual = "." }
+
+[package.dev-dependencies]
+dev = [
+ { name = "actionlint-py" },
+ { name = "ast-grep-cli" },
+ { name = "prek" },
+ { name = "ruff" },
+ { name = "rumdl" },
+ { name = "shellcheck-py" },
+ { name = "zizmor" },
+]
+
+[package.metadata]
+
+[package.metadata.requires-dev]
+dev = [
+ { name = "actionlint-py", specifier = "==1.7.10.24" },
+ { name = "ast-grep-cli", specifier = "==0.40.5" },
+ { name = "prek", specifier = "==0.3.1" },
+ { name = "ruff", specifier = "==0.14.14" },
+ { name = "rumdl", specifier = "==0.1.7" },
+ { name = "shellcheck-py", specifier = "==0.11.0.1" },
+ { name = "zizmor", specifier = "==1.22.0" },
+]
+
+[[package]]
+name = "prek"
+version = "0.3.1"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/76/62/4b91c8a343e21fcefabc569a91d08cf8756c554332521af78294acef7c27/prek-0.3.1.tar.gz", hash = "sha256:45abc4ffd3cb2d39c478f47e92e88f050e5a4b7a20915d78e54b1a3d3619ebe4", size = 323141, upload-time = "2026-01-31T13:25:58.128Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/ab/c1/e0e545048e4190245fb4ae375d67684108518f3c69b67b81d62e1cd855c6/prek-0.3.1-py3-none-linux_armv6l.whl", hash = "sha256:1f77d0845cc63cad9c447f7f7d554c1ad188d07dbe02741823d20d58c7312eaf", size = 4285460, upload-time = "2026-01-31T13:25:42.066Z" },
+ { url = "https://files.pythonhosted.org/packages/10/fe/7636d10e2dafdf2a4a927c989f32ce3f08e99d62ebad7563f0272e74b7f4/prek-0.3.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:e21142300d139e8c7f3970dd8aa66391cb43cd17c0c4ee65ff1af48856bb6a4b", size = 4287085, upload-time = "2026-01-31T13:25:40.193Z" },
+ { url = "https://files.pythonhosted.org/packages/a3/7f/62ed57340071e04c02057d64276ec3986baca3ad4759523e2f433dc9be55/prek-0.3.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c09391de7d1994f9402c46cb31671800ea309b1668d839614965706206da3655", size = 3936188, upload-time = "2026-01-31T13:25:47.314Z" },
+ { url = "https://files.pythonhosted.org/packages/6b/17/cb24f462c255f76d130ca110f4fcec09b041c3c770e43960cc3fc9dcc9ce/prek-0.3.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:a0b0a012ef6ef28dee019cf81a95c5759b2c03287c32c1f2adcb5f5fb097138e", size = 4275214, upload-time = "2026-01-31T13:25:38.053Z" },
+ { url = "https://files.pythonhosted.org/packages/f2/85/db155b59d73cf972c8467e4d95def635f9976d5fcbcc790a4bbe9d2e049a/prek-0.3.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f4a0e40785d39b8feae0d7ecf5534789811a2614114ab47f4e344a2ebd75ac10", size = 4197982, upload-time = "2026-01-31T13:25:50.034Z" },
+ { url = "https://files.pythonhosted.org/packages/06/cf/d35c32436692928a9ca53eed3334e30148a60f0faa33c42e8d11b6028fa6/prek-0.3.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ac5c2f5e377e3cc5a5ea191deb8255a5823fbaa01b424417fe18ff12c7c800f3", size = 4458572, upload-time = "2026-01-31T13:25:51.46Z" },
+ { url = "https://files.pythonhosted.org/packages/b4/c0/eb36fecb21fe30baa72fb87ccf3a791c32932786c287f95f8972402e9245/prek-0.3.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9fe70e97f4dfca57ce142caecd77b90a435abd1c855f9e96041078415d80e89a", size = 4999230, upload-time = "2026-01-31T13:25:44.055Z" },
+ { url = "https://files.pythonhosted.org/packages/e4/f3/ad1a25ea16320e6acd1fedd6bd96a0d22526f5132d9b5adc045996ccca4c/prek-0.3.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b28e921d893771bdd7533cd94d46a10e0cf2855c5e6bf6809b598b5e45baa73", size = 4510376, upload-time = "2026-01-31T13:25:48.563Z" },
+ { url = "https://files.pythonhosted.org/packages/39/b7/91afdd24be808ccf3b9119f4cf2bd6d02e30683143a62a08f432a3435861/prek-0.3.1-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:555610a53c4541976f4fe8602177ecd7a86a931dcb90a89e5826cfc4a6c8f2cb", size = 4273229, upload-time = "2026-01-31T13:25:56.362Z" },
+ { url = "https://files.pythonhosted.org/packages/5a/bb/636c77c5c9fc5eadcc2af975a95b48eeeff2dc833021e222b0e9479b9b47/prek-0.3.1-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:663a15a31b705db5d01a1c9eb28c6ea417628e6cb68de2dc7b3016ca2f959a99", size = 4301166, upload-time = "2026-01-31T13:25:36.281Z" },
+ { url = "https://files.pythonhosted.org/packages/4e/cf/c928a36173e71b21b252943404a5b3d1ddc1f08c9e0f1d7282a2c62c7325/prek-0.3.1-py3-none-musllinux_1_1_armv7l.whl", hash = "sha256:1d03fb5fa37177dc37ccbe474252473adcbde63287a63e9fa3d5745470f95bd8", size = 4188473, upload-time = "2026-01-31T13:25:53.341Z" },
+ { url = "https://files.pythonhosted.org/packages/98/4c/af8f6a40cb094e88225514b89e8ae05ac69fc479d6b500e4b984f9ef8ae3/prek-0.3.1-py3-none-musllinux_1_1_i686.whl", hash = "sha256:3e20a5b704c06944dca9555a39f1de3622edc8ed2becaf8b3564925d1b7c1c0d", size = 4342239, upload-time = "2026-01-31T13:25:55.179Z" },
+ { url = "https://files.pythonhosted.org/packages/b7/ba/6b0f725c0cf96182ab9622b4d122a01f04de9b2b6e4a6516874390218510/prek-0.3.1-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:6889acf0c9b0dd7b9cd3510ec36af10a739826d2b9de1e2d021ae6a9f130959a", size = 4618674, upload-time = "2026-01-31T13:25:59.175Z" },
+ { url = "https://files.pythonhosted.org/packages/d8/49/caa320893640c9e72ed3d3e2bab7959faba54cefeea09be18c33d5f75baf/prek-0.3.1-py3-none-win32.whl", hash = "sha256:cc62a4bff79ed835d448098f0667c1a91915cec9cfac6c6246b675f0da46eded", size = 3928699, upload-time = "2026-01-31T13:25:33.168Z" },
+ { url = "https://files.pythonhosted.org/packages/59/19/15907abe245ae9a120abcebb0c50c6d456ba719eb640f7c57e4f5b2f00e3/prek-0.3.1-py3-none-win_amd64.whl", hash = "sha256:3515140def20bab85e53585b0beb90d894ff2915d2fdb4451b6a4588e16516d8", size = 4296106, upload-time = "2026-01-31T13:25:45.606Z" },
+ { url = "https://files.pythonhosted.org/packages/a6/5e/9b994b5de36d6aa5caaf09a018d8fe4820db46e4da577c2fd7a1e176b56c/prek-0.3.1-py3-none-win_arm64.whl", hash = "sha256:cfa58365eb36753cff684dc3b00196c1163bb135fe72c6a1c6ebb1a179f5dbdf", size = 4021714, upload-time = "2026-01-31T13:25:34.993Z" },
+]
+
+[[package]]
+name = "ruff"
+version = "0.14.14"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/2e/06/f71e3a86b2df0dfa2d2f72195941cd09b44f87711cb7fa5193732cb9a5fc/ruff-0.14.14.tar.gz", hash = "sha256:2d0f819c9a90205f3a867dbbd0be083bee9912e170fd7d9704cc8ae45824896b", size = 4515732, upload-time = "2026-01-22T22:30:17.527Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/d2/89/20a12e97bc6b9f9f68343952da08a8099c57237aef953a56b82711d55edd/ruff-0.14.14-py3-none-linux_armv6l.whl", hash = "sha256:7cfe36b56e8489dee8fbc777c61959f60ec0f1f11817e8f2415f429552846aed", size = 10467650, upload-time = "2026-01-22T22:30:08.578Z" },
+ { url = "https://files.pythonhosted.org/packages/a3/b1/c5de3fd2d5a831fcae21beda5e3589c0ba67eec8202e992388e4b17a6040/ruff-0.14.14-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:6006a0082336e7920b9573ef8a7f52eec837add1265cc74e04ea8a4368cd704c", size = 10883245, upload-time = "2026-01-22T22:30:04.155Z" },
+ { url = "https://files.pythonhosted.org/packages/b8/7c/3c1db59a10e7490f8f6f8559d1db8636cbb13dccebf18686f4e3c9d7c772/ruff-0.14.14-py3-none-macosx_11_0_arm64.whl", hash = "sha256:026c1d25996818f0bf498636686199d9bd0d9d6341c9c2c3b62e2a0198b758de", size = 10231273, upload-time = "2026-01-22T22:30:34.642Z" },
+ { url = "https://files.pythonhosted.org/packages/a1/6e/5e0e0d9674be0f8581d1f5e0f0a04761203affce3232c1a1189d0e3b4dad/ruff-0.14.14-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f666445819d31210b71e0a6d1c01e24447a20b85458eea25a25fe8142210ae0e", size = 10585753, upload-time = "2026-01-22T22:30:31.781Z" },
+ { url = "https://files.pythonhosted.org/packages/23/09/754ab09f46ff1884d422dc26d59ba18b4e5d355be147721bb2518aa2a014/ruff-0.14.14-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3c0f18b922c6d2ff9a5e6c3ee16259adc513ca775bcf82c67ebab7cbd9da5bc8", size = 10286052, upload-time = "2026-01-22T22:30:24.827Z" },
+ { url = "https://files.pythonhosted.org/packages/c8/cc/e71f88dd2a12afb5f50733851729d6b571a7c3a35bfdb16c3035132675a0/ruff-0.14.14-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1629e67489c2dea43e8658c3dba659edbfd87361624b4040d1df04c9740ae906", size = 11043637, upload-time = "2026-01-22T22:30:13.239Z" },
+ { url = "https://files.pythonhosted.org/packages/67/b2/397245026352494497dac935d7f00f1468c03a23a0c5db6ad8fc49ca3fb2/ruff-0.14.14-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:27493a2131ea0f899057d49d303e4292b2cae2bb57253c1ed1f256fbcd1da480", size = 12194761, upload-time = "2026-01-22T22:30:22.542Z" },
+ { url = "https://files.pythonhosted.org/packages/5b/06/06ef271459f778323112c51b7587ce85230785cd64e91772034ddb88f200/ruff-0.14.14-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:01ff589aab3f5b539e35db38425da31a57521efd1e4ad1ae08fc34dbe30bd7df", size = 12005701, upload-time = "2026-01-22T22:30:20.499Z" },
+ { url = "https://files.pythonhosted.org/packages/41/d6/99364514541cf811ccc5ac44362f88df66373e9fec1b9d1c4cc830593fe7/ruff-0.14.14-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1cc12d74eef0f29f51775f5b755913eb523546b88e2d733e1d701fe65144e89b", size = 11282455, upload-time = "2026-01-22T22:29:59.679Z" },
+ { url = "https://files.pythonhosted.org/packages/ca/71/37daa46f89475f8582b7762ecd2722492df26421714a33e72ccc9a84d7a5/ruff-0.14.14-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb8481604b7a9e75eff53772496201690ce2687067e038b3cc31aaf16aa0b974", size = 11215882, upload-time = "2026-01-22T22:29:57.032Z" },
+ { url = "https://files.pythonhosted.org/packages/2c/10/a31f86169ec91c0705e618443ee74ede0bdd94da0a57b28e72db68b2dbac/ruff-0.14.14-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:14649acb1cf7b5d2d283ebd2f58d56b75836ed8c6f329664fa91cdea19e76e66", size = 11180549, upload-time = "2026-01-22T22:30:27.175Z" },
+ { url = "https://files.pythonhosted.org/packages/fd/1e/c723f20536b5163adf79bdd10c5f093414293cdf567eed9bdb7b83940f3f/ruff-0.14.14-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:e8058d2145566510790eab4e2fad186002e288dec5e0d343a92fe7b0bc1b3e13", size = 10543416, upload-time = "2026-01-22T22:30:01.964Z" },
+ { url = "https://files.pythonhosted.org/packages/3e/34/8a84cea7e42c2d94ba5bde1d7a4fae164d6318f13f933d92da6d7c2041ff/ruff-0.14.14-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e651e977a79e4c758eb807f0481d673a67ffe53cfa92209781dfa3a996cf8412", size = 10285491, upload-time = "2026-01-22T22:30:29.51Z" },
+ { url = "https://files.pythonhosted.org/packages/55/ef/b7c5ea0be82518906c978e365e56a77f8de7678c8bb6651ccfbdc178c29f/ruff-0.14.14-py3-none-musllinux_1_2_i686.whl", hash = "sha256:cc8b22da8d9d6fdd844a68ae937e2a0adf9b16514e9a97cc60355e2d4b219fc3", size = 10733525, upload-time = "2026-01-22T22:30:06.499Z" },
+ { url = "https://files.pythonhosted.org/packages/6a/5b/aaf1dfbcc53a2811f6cc0a1759de24e4b03e02ba8762daabd9b6bd8c59e3/ruff-0.14.14-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:16bc890fb4cc9781bb05beb5ab4cd51be9e7cb376bf1dd3580512b24eb3fda2b", size = 11315626, upload-time = "2026-01-22T22:30:36.848Z" },
+ { url = "https://files.pythonhosted.org/packages/2c/aa/9f89c719c467dfaf8ad799b9bae0df494513fb21d31a6059cb5870e57e74/ruff-0.14.14-py3-none-win32.whl", hash = "sha256:b530c191970b143375b6a68e6f743800b2b786bbcf03a7965b06c4bf04568167", size = 10502442, upload-time = "2026-01-22T22:30:38.93Z" },
+ { url = "https://files.pythonhosted.org/packages/87/44/90fa543014c45560cae1fffc63ea059fb3575ee6e1cb654562197e5d16fb/ruff-0.14.14-py3-none-win_amd64.whl", hash = "sha256:3dde1435e6b6fe5b66506c1dff67a421d0b7f6488d466f651c07f4cab3bf20fd", size = 11630486, upload-time = "2026-01-22T22:30:10.852Z" },
+ { url = "https://files.pythonhosted.org/packages/9e/6a/40fee331a52339926a92e17ae748827270b288a35ef4a15c9c8f2ec54715/ruff-0.14.14-py3-none-win_arm64.whl", hash = "sha256:56e6981a98b13a32236a72a8da421d7839221fa308b223b9283312312e5ac76c", size = 10920448, upload-time = "2026-01-22T22:30:15.417Z" },
+]
+
+[[package]]
+name = "rumdl"
+version = "0.1.7"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/ed/c2/321d64c21d88051aeca0c7a375423d934b8f91b637634c1c59f854d68022/rumdl-0.1.7.tar.gz", hash = "sha256:a0a53686c5da21f8f9134676749f351a4f5de538da7a2200d61b3baed1c927af", size = 1756601, upload-time = "2026-01-30T18:47:20.037Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/04/38/eb80bec4e50a8f582b8645d2e4449a74f954a7019e56a06b539b7ff2b4b9/rumdl-0.1.7-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:8d4b0353958930422775c105e31f2211c3c567d7c5de3846d2adaa90cf24aa42", size = 3240170, upload-time = "2026-01-30T18:47:10.347Z" },
+ { url = "https://files.pythonhosted.org/packages/4a/4d/c22f48f3acb6cc1ca4bfc32626b947ef60fe470aa42f6d95071be745aaa3/rumdl-0.1.7-py3-none-macosx_11_0_arm64.whl", hash = "sha256:9bb9712525f185150b35b0a29a83da713cc33fb5c7e1772a3b4411150525744e", size = 3107139, upload-time = "2026-01-30T18:47:04.853Z" },
+ { url = "https://files.pythonhosted.org/packages/60/c3/649a4afc1986923030f521789f633308491f8e74b1c0734d11de04453e90/rumdl-0.1.7-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:b8bb89d5a0688d735e75ed1937e2bead0abee82eda9691001ef9bb70e9348dc2", size = 3478868, upload-time = "2026-01-30T18:47:06.785Z" },
+ { url = "https://files.pythonhosted.org/packages/e2/e3/3beb7232547aca68d1dd8fe745fbfe9903639adc292588e4a5a6f4ffe2ac/rumdl-0.1.7-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:d8b1867c8854d9d0fffab0491e8ac2b896b0b3aea347d3828928206ec19e90bd", size = 3534162, upload-time = "2026-01-30T18:47:16.403Z" },
+ { url = "https://files.pythonhosted.org/packages/91/61/cbe8674293d9f36c2fae1549a528da95172c81f065a5a2d184ef8d6bbad6/rumdl-0.1.7-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a46e50122b605a8d4a9945063f532ab8d40d70abba794cf444bd8fc0707f7acd", size = 3468256, upload-time = "2026-01-30T18:47:08.331Z" },
+ { url = "https://files.pythonhosted.org/packages/24/4a/9be0d3f134e966a11618d5aa2402f96a2a2430df0581421c038f143bc338/rumdl-0.1.7-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5fa8b0403d83f5b0e9402b82c358db7d7568992013950faac0fd9dedbe536ccd", size = 3522873, upload-time = "2026-01-30T18:47:18.402Z" },
+ { url = "https://files.pythonhosted.org/packages/87/ee/c2f9cdb19b04775fc7ca2c8f1ec535cf0d7e561ca3b7cf556249084cf3af/rumdl-0.1.7-py3-none-win_amd64.whl", hash = "sha256:e2c8a7f1ad675db2d537bfd6dcac151b0737f03f5534dec22c34f38c95a98e8b", size = 3326346, upload-time = "2026-01-30T18:47:12.374Z" },
+]
+
+[[package]]
+name = "shellcheck-py"
+version = "0.11.0.1"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/df/55/455b097417b3df3d330eff029c72c32f08b25739e3010acb30ad06d268ef/shellcheck_py-0.11.0.1.tar.gz", hash = "sha256:5c620c88901e8f1d3be5934b31ea99e3310065e1245253741eafd0a275c8c9cc", size = 3139, upload-time = "2025-08-09T17:53:42.492Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/54/27/d75b03e5458cefdb6d3b674566cd20476c3e4d3fe6cc9d68b7e3b854b296/shellcheck_py-0.11.0.1-py2.py3-none-macosx_10_9_x86_64.whl", hash = "sha256:b6a3fee28efda2e16e38d6e6d59faf7224300256456639727370d404730849e8", size = 6774472, upload-time = "2025-08-09T17:53:34.573Z" },
+ { url = "https://files.pythonhosted.org/packages/61/ac/2a84c37171c0cf5a10ea4b0a27d43eb0a1d29bd98b49c2c5ffe17ad24bbe/shellcheck_py-0.11.0.1-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:6b88d0a244c82ed07e06a53e444da841f69330ca59ae15d4a66c391655dae7a0", size = 11381835, upload-time = "2025-08-09T17:53:36.852Z" },
+ { url = "https://files.pythonhosted.org/packages/96/55/250e0e3367613a5c22bd82e33b16b889287d81ab0f7dda67e6514a4cccf4/shellcheck_py-0.11.0.1-py2.py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1b274df81de5b000ff78db433e7328b87e52e3c38481c60f8e488c3095beef05", size = 3800600, upload-time = "2025-08-09T17:53:38.643Z" },
+ { url = "https://files.pythonhosted.org/packages/15/5b/bb14c0a7474463b1aa3c09e866cb172dffc66ed2993b7ea8f1db581e86ee/shellcheck_py-0.11.0.1-py2.py3-none-win_amd64.whl", hash = "sha256:784156289ecb17e91c692cd783ab5152333309588cabb10032a047331c63e759", size = 8027541, upload-time = "2025-08-09T17:53:40.889Z" },
+]
+
+[[package]]
+name = "zizmor"
+version = "1.22.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/4b/4a/acd3130f17a7cdc5793d5f73a47e06f2c1576b16432dbeabf221a2625204/zizmor-1.22.0.tar.gz", hash = "sha256:b36a24cf52af902fbf5526d9ed6b6e665cc418b7c76c93dd018225a385691200", size = 435030, upload-time = "2026-01-17T05:19:58.084Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/e1/c8/d45323e1ce1663ba099e777d3cd32e697f240dd0e5209a81b604d6447d46/zizmor-1.22.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:80c62a9503a4235091dd076c11925f98f8d0e3fcaa8a6e2e1153e784ff3e0062", size = 7821971, upload-time = "2026-01-17T05:20:17.003Z" },
+ { url = "https://files.pythonhosted.org/packages/4c/bc/69c0f86b92c7b70407d90961226149c275f988a73a67e5660ef326bfd069/zizmor-1.22.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:05c62d8cc0c16e0c0551e5085ef1f367d3b70e18df6ff1dcb212f6a6355bee4e", size = 7472452, upload-time = "2026-01-17T05:20:10.327Z" },
+ { url = "https://files.pythonhosted.org/packages/3b/2f/5a4451dd0321c9f608821ca196ec35935d4394d6a3404fb1b37f94513d0e/zizmor-1.22.0-py3-none-manylinux_2_24_aarch64.whl", hash = "sha256:92d90fbebdcbd865ff8d48a8579a23102c788d09e378b60d3452603eb15e69bc", size = 7787396, upload-time = "2026-01-17T05:20:00.102Z" },
+ { url = "https://files.pythonhosted.org/packages/1c/8a/1b27a90e3b54ca925ed080cadfa083ada4779ac8aef973fd9fe0da4496a7/zizmor-1.22.0-py3-none-manylinux_2_28_armv7l.whl", hash = "sha256:4f81f527ea5f628537f1a80c63a832f6ee1d529201ecd473f1c06fe28498ecc1", size = 7461205, upload-time = "2026-01-17T05:20:02.78Z" },
+ { url = "https://files.pythonhosted.org/packages/72/98/44e308c7f365f5f9e672b3d581224e50d0c7a397dcebd3fba93869487dc5/zizmor-1.22.0-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:ccc9fe012ca9068add4104fcf75513fb740d41056c238f98dcf97d693feaa743", size = 8018731, upload-time = "2026-01-17T05:20:14.59Z" },
+ { url = "https://files.pythonhosted.org/packages/f6/3b/589f3c0145f0e5584ef5cbf7de8c000ab7bfc86618f9c5a77def842c6328/zizmor-1.22.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:aad09a0788df8d8e9941d47743029f182434599548a463733240b09983b9870e", size = 7811279, upload-time = "2026-01-17T05:20:07.987Z" },
+ { url = "https://files.pythonhosted.org/packages/de/e2/9067973b9064a3f1f32e7ccb0e34004a713d5dec033c38e829421bc5655c/zizmor-1.22.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a2f3f9d2dc341921543374f75cbd99cad130676809854c3c0fb38fa44fb9ebee", size = 7472910, upload-time = "2026-01-17T05:19:53.565Z" },
+ { url = "https://files.pythonhosted.org/packages/1d/ae/803063f38f70b4e5d51f0e7d0626322730fab44278aeb7b5201a5be2400a/zizmor-1.22.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:8fbc43d9feec0e6f85dfb324956f41a58e649763fe8b269ca1c2c4d61f27764d", size = 8126935, upload-time = "2026-01-17T05:20:12.628Z" },
+ { url = "https://files.pythonhosted.org/packages/0b/b4/c1d6b7e7c53ecfa64677aa4891b1ad10a3fc8cfc59c6c458a0b7d768c4d3/zizmor-1.22.0-py3-none-win32.whl", hash = "sha256:05b906d08b7fa70474ad99b95ae6e332e6d527089821df71b739107488aad303", size = 6618441, upload-time = "2026-01-17T05:19:56.295Z" },
+ { url = "https://files.pythonhosted.org/packages/30/fd/d4eb5a558e28b42d257eba609e01fa65ae167589d9ff87e9d265ea1766b3/zizmor-1.22.0-py3-none-win_amd64.whl", hash = "sha256:2d52bc8367986c046c116134800117bd5ad4816922e890e81b9bd37a7b28c28f", size = 7617357, upload-time = "2026-01-17T05:20:05.308Z" },
+]
diff --git a/gradle/validation/ast-grep/rules/syntax.yml b/gradle/validation/ast-grep/rules/syntax.yml
index 823aba71642..6937cac7bee 100644
--- a/gradle/validation/ast-grep/rules/syntax.yml
+++ b/gradle/validation/ast-grep/rules/syntax.yml
@@ -38,36 +38,3 @@ severity: hint
note: |
Treesitter parse error: editors, code review, and tools may treat it incorrectly.
Disable false-positives with `// ast-grep-ignore`
----
-# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/refs/heads/main/schemas/rule.json
-id: json-syntax
-language: json
-rule:
- kind: ERROR
-message: Parse Error
-severity: hint
-note: |
- Treesitter parse error: editors, code review, and tools may treat it incorrectly.
- Check for trailing commas and comments, which JSON forbids.
----
-# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/refs/heads/main/schemas/rule.json
-id: python-syntax
-language: python
-rule:
- kind: ERROR
-message: Parse Error
-severity: hint
-note: |
- Treesitter parse error: editors, code review, and tools may treat it incorrectly.
- Disable false-positives with `# ast-grep-ignore`
----
-# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/refs/heads/main/schemas/rule.json
-id: yaml-syntax
-language: yml
-rule:
- kind: ERROR
-message: Parse Error
-severity: hint
-note: |
- Treesitter parse error: editors, code review, and tools may treat it incorrectly.
- Disable false-positives with `# ast-grep-ignore`
diff --git a/gradle/validation/ast-grep/tests/syntax.yml b/gradle/validation/ast-grep/tests/syntax.yml
index 46ea355d019..0a783ecabc9 100644
--- a/gradle/validation/ast-grep/tests/syntax.yml
+++ b/gradle/validation/ast-grep/tests/syntax.yml
@@ -14,17 +14,3 @@ valid:
id: javascript-syntax
valid:
- x = 1;
----
-id: json-syntax
-valid:
- - |
- []
----
-id: python-syntax
-valid:
- - x = 1
----
-id: yaml-syntax
-valid:
- - |
- foo: bar
diff --git a/help/formatting.txt b/help/formatting.txt
index 79d5e5e0be4..ea0de58522a 100644
--- a/help/formatting.txt
+++ b/help/formatting.txt
@@ -14,12 +14,8 @@ your code so that it complies with the convention and passes gradle
IMPORTANT: wildcard imports are banned but google java format doesn't
detect or fix this. There is a check for wildcard imports implemented
-on top of the ast-grep tool (https://ast-grep.github.io/). This tool is
-optional. If you'd like to run it locally on gradle's 'check' task,
-install ast-grep locally and add this build option to
-build-options.local.properties:
-
-lucene.tool.ast-grep=ast-grep
+as a precommit check: you can run it via `uvx prek`. See precommit.txt
+help file for detailed instructions.
IMPORTANT: There is *no* way to mark sections of the code as excluded
from formatting. This is by design and cannot be altered. In the vast
diff --git a/help/precommit.txt b/help/precommit.txt
new file mode 100644
index 00000000000..22f1275e908
--- /dev/null
+++ b/help/precommit.txt
@@ -0,0 +1,22 @@
+Precommit Checks
+================
+
+Precommit checks are run by CI on your pull request.
+
+Checks use the prek tool:
+ * src: https://github.com/j178/prek
+ * docs: https://prek.j178.dev/
+
+To run checks before committing:
+
+uvx prek
+
+To install a precommit hook so this happens automatically:
+
+uvx prek install
+
+To exhaustively force-check all files (like CI does):
+
+uvx prek --all-files
+
+You need the uv package manager: https://docs.astral.sh/uv/getting-started/installation/
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 739943b899b..31a7c5aa45d 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -145,6 +145,12 @@ Build
* GITHUB#14808: Add support for validating sources using ast-grep tool rules #14808
(Robert Muir, Dawid Weiss)
+* GITHUB#15629: Introduce prek for fast pre-commit/repository checks.
+ Markdown files are now linted with local broken-link detection.
+ Python and Shell scripts are now linted system-wide.
+ Install with `uvx prek install`
+ For more see help/precommit.txt or `./gradlew helpPrecommit` (Robert Muir)
+
Other
---------------------