Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions prek.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ exclude = { glob = [
"**/*.ps",
"**/*.ps-*",
"**/*.svg",
"**/COPYING",
"**/*expected*",
"**/COPYING",
"src/main/resources/specifications/jdk/*",
"src/test/resources/end-to-end/**/*",
"tests/kvasir-tests/povray/*",
] }

[[repos]]
Expand All @@ -36,9 +38,7 @@ hooks = [
] } },
{ id = "check-json" },
{ id = "check-merge-conflict" },
{ id = "check-shebang-scripts-are-executable", exclude = { glob = [
"tests/kvasir-tests/povray/source/**",
] } },
{ id = "check-shebang-scripts-are-executable" },
{ id = "check-symlinks", exclude = { glob = [
".subversion/auth",
"dots/.subversion/auth",
Expand All @@ -59,7 +59,6 @@ hooks = [
"**/tests/squeeze-blank-lines-test/**",
"bugs/jikes-patches/*",
"java/jtb/**",
"src/main/resources/specifications/jdk",
"tests/kvasir-tests/**",
] } },
{ id = "file-contents-sorter", files = { glob = [
Expand Down Expand Up @@ -87,6 +86,17 @@ hooks = [
] } },
]

## CircleCI

# This doesn't install the tool! It fails with "Circleci CLI could not be
# found." unless you have installed the CircleCI CLI. Using `snap` to install
# leads to permission problems due to snap confinement. To install:
# - run: curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/main/install.sh | sudo bash
[[repos]]
repo = "https://github.com/zahorniak/pre-commit-circleci"
rev = "v1.3.0"
hooks = [{ id = "circleci_validate" }]

Comment on lines +89 to +99

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== candidate files =="
git ls-files | rg '(^|/)prek\.toml$|(^|/)\.circleci/|^\.github/workflows/|(^|/)pre-commit-hooks\.yaml$' || true

echo
echo "== prek.toml relevant lines =="
if [ -f prek.toml ]; then
  nl -ba prek.toml | sed -n '75,110p'
fi

echo
echo "== .circleci tracked? =="
git ls-files .circleci || true

echo
echo "== CircleCI files if any =="
find .circleci -maxdepth 3 -type f 2>/dev/null | sed 's#^\./##' || true

echo
echo "== workflows =="
for f in $(git ls-files '.github/workflows/*'); do
  echo "--- $f"
  nl -ba "$f" | sed -n '1,180p'
done

echo
echo "== hook refs/tests around circleci_validate =="
rg -n "circleci_validate|pre-commit-circleci|CircleCI|\.circleci" -S . --glob '!**/node_modules/**' --glob '!**/.git/**' || true

echo
echo "== remote hook manifest if present in repo/cache? =="
if git ls-files | rg 'pre-commit-circleci/.pre-commit-hooks\.yaml$' >/dev/null; then
  for f in $(git ls-files | rg 'pre-commit-circleci/.pre-commit-hooks\.yaml$'); do
    echo "--- $f"
    nl -ba "$f" | sed -n '1,120p'
  done
else
  echo "repo-local pre-commit-circleci/.pre-commit-hooks.yaml not found"
fi

Repository: plume-lib/git-scripts

Length of output: 319


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== file sizes =="
wc -l prek.toml .github/workflows/prek.yaml .github/workflows/test.yml

echo
echo "== prek.toml relevant lines =="
awk 'NR>=1;NR<=120{printf "%6d  %s\n", NR, $0}' prek.toml | sed -n '75,110p'

echo
echo "== .circleci tracked? =="
git ls-files .circleci || true

echo
echo "== GitHub workflows =="
for f in .github/workflows/prek.yaml .github/workflows/test.yml; do
  echo "--- $f"
  awk 'NR>=1{printf "%6d  %s\n", NR, $0}' "$f"
done

echo
echo "== CircleCI references and CLI installs =="
rg -n "circleci_validate|pre-commit-circleci|CircleCI|\.circleci|circle ci|circleci install|curl .*install\.sh|apt|apk|brew|sudo" -S . --glob '!**/node_modules/**' --glob '!**/.git/**' || true

Repository: plume-lib/git-scripts

Length of output: 3711


🌐 Web query:

https://raw.githubusercontent.com/zahorniak/pre-commit-circleci/v1.3.0/.pre-commit-hooks.yaml

💡 Result:

The file.pre-commit-hooks.yaml is a required configuration file in the pre-commit framework that defines the plugins (hooks) available within a git repository [1][2]. For the repository zahorniak/pre-commit-circleci, this file serves as the manifest that tells the pre-commit framework how to run CircleCI-related tasks [3]. Specifically, in version v1.3.0 of zahorniak/pre-commit-circleci, the.pre-commit-hooks.yaml file defines the interface for the following hooks [3]: circleci_validate: Executes circleci config validate to ensure your CircleCI configuration file is syntactically correct [3]. circleci_process: Executes circleci config process to expand your CircleCI configuration (useful for processing orbs and dynamic configurations) [3]. circleci_pack: Executes circleci config pack to package modular configuration files from a source directory [3]. circleci_pack_validate: Combines packing and validation, typically used for projects utilizing CircleCI dynamic configuration and the continuation orb [3]. By including this file, the repository enables users to integrate these specific CircleCI operations into their local git workflow by adding the repository as a dependency in their own.pre-commit-config.yaml file [3]. The file specifies essential metadata for each hook, including the hook ID, the entry point (the command to execute), and the language (how the hook should be installed and run) [1][2].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== remote hook manifest line 1-120 =="
curl -fsSL -o /tmp/prek-toml-circleci-hooks.yaml 'https://raw.githubusercontent.com/zahorniak/pre-commit-circleci/v1.3.0/.pre-commit-hooks.yaml' || { echo "failed to fetch"; true; }
awk 'NR>=1;NR<=120{printf "%6d  %s\n", NR, $0}' /tmp/prek-toml-circleci-hooks.yaml

echo
echo "== exact circleci_validate hook shape =="
awk '/^- name: circleci_validate/,/^  / || NR==1{print NR, $0}' /tmp/prek-toml-circleci-hooks.yaml | sed -n '1,40p' || true
python3 - <<'PY'
import re, urllib.request
url='https://raw.githubusercontent.com/zahorniak/pre-commit-circleci/v1.3.0/.pre-commit-hooks.yaml'
text=urllib.request.urlopen(url, timeout=10).read().decode()
for i,line in enumerate(text.splitlines(),1):
    if 'circleci_validate' in line:
        start=max(1,i-5); end=i+30
        for n,l in enumerate(text.splitlines()[start-1:end],start):
            print(f"{n:6d} {l}")
PY

Repository: plume-lib/git-scripts

Length of output: 4625


Provision the circleci-validate tool before enabling this hook.

circleci_validate runs circleci-validate, but the workflow only installs prek and has no CircleCI CLI provisioning. CI already checks .github/workflows/prek.yaml, so this hook can pick up workflow files before .circleci exists and fail unless the tool is installed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@prek.toml` around lines 89 - 99, Provision the CircleCI CLI, including the
circleci-validate tool, in the CI setup before the pre-commit hooks run. Update
the workflow’s installation steps associated with prek so the circleci_validate
hook in prek.toml can execute before validating workflow files, while preserving
the existing prek checks.

## GitHub Actions

[[repos]]
Expand All @@ -105,6 +115,8 @@ hooks = [
"**/pubs-bytopic-headfoot.html",
"**/pubs-bytopic-underreview-headfoot.html",
"google04aaa4eb05fd668b.html",
"pubs/*-abstract.html",
"pubs/index.html",
"tests/sources/six170/huffman.html",
"tools/hierarchical/clustering.html",
] } },
Expand All @@ -117,13 +129,16 @@ hooks = [
[[repos]]
repo = "local"
hooks = [
{ id = "gradle-spotless", name = "spotless formatting", language = "unsupported", entry = "bash -c 'if [ -f ./gradlew ] ; then ./gradlew spotlessApply; fi'", files = "\\.java$", pass_filenames = false },
{ id = "gradle-spotless", name = "spotless formatting", language = "unsupported", entry = "bash -c 'if [ -f ./gradlew ] ; then ./gradlew spotlessApply; fi'", files = { glob = [
"**/*.java",
"**/*.gradle.kts",
] }, pass_filenames = false },
]

## Makefiles

[[repos]]
repo = "https://github.com/checkmake/checkmake.git"
repo = "https://github.com/checkmake/checkmake"
rev = "0.2.2"
hooks = [
{ id = "checkmake", args = [
Expand Down Expand Up @@ -214,7 +229,6 @@ hooks = [
"tests/kvasir-tests/tot_info/tests.sh",
"cronic-orig",
"classfile_check_version",
"tests/kvasir-tests/povray/**/*",
] } },
]

Expand Down Expand Up @@ -321,6 +335,6 @@ hooks = [
]

[[repos]]
repo = "https://github.com/adrienverge/yamllint.git"
rev = "v1.29.0"
repo = "https://github.com/adrienverge/yamllint"
rev = "v1.38.0"
hooks = [{ id = "yamllint" }]