Skip to content

Replace lefthook with prek for pre-commit hooks#279

Merged
Ven0m0 merged 5 commits into
mainfrom
claude/todo-implementation-8twsht
Jul 7, 2026
Merged

Replace lefthook with prek for pre-commit hooks#279
Ven0m0 merged 5 commits into
mainfrom
claude/todo-implementation-8twsht

Conversation

@Ven0m0

@Ven0m0 Ven0m0 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Migrate from lefthook to prek, a faster pre-commit-compatible hook runner. This change updates documentation, configuration references, and removes the blanket Electron security warning suppression that was masking real misconfiguration signals.

Key Changes

  • Git hooks migration: Replace lefthook with prek throughout documentation

    • Updated README.md with new installation methods (script, Homebrew, uv, pipx)
    • Changed hook invocation from lefthook run pre-commit to prek run --all-files
    • Updated skip syntax from LEFTHOOK=0 to SKIP=<hook-id>
    • Clarified that hooks are defined in .pre-commit-config.yaml
  • Security fix: Remove ELECTRON_DISABLE_SECURITY_WARNINGS=true from filen-desktop/filen-desktop.sh

    • Blanket suppression was masking real Electron misconfiguration signals
    • Verified no specific warnings require targeted --disable-features= flags
  • nvchecker.toml fixes: Resolve version tracking issues that were blocking automated updates

    • dxvk-gplasync-lowlatency: Added include_regex = "^DXVK-GPLALL-.*" to filter candidates before use_max_tag comparison (prefix-only stripping doesn't filter pre-selection)
    • update-alternatives: Corrected branch from main to master (repo's actual default) and added use_commit = true since the repo has no tags
    • lib32-zlib-ng: Fixed include_regex from ^2\. to ^2\..* (fullmatch requires matching the entire tag string, not just 2 characters)
  • Documentation updates: Mark completed tasks in TODO.md and PLAN.md with explanations of fixes applied

Implementation Details

  • All hook runner references updated consistently across README and documentation
  • nvchecker regex fixes address the root causes of version tracking failures (candidate filtering and fullmatch semantics)
  • Electron security warning removal is a pure deletion with no replacement needed

https://claude.ai/code/session_01X7pjimgiitGZb2Jx7KfZqm

claude added 2 commits July 7, 2026 03:09
- dxvk/dxvk-gplasync: use_max_tag selects the max across all tags in the
  repo before prefix stripping is applied, so unrelated tags could
  outrank the real release and cause a reported downgrade. Add
  include_regex to restrict candidates to the DXVK-GPLALL-* release line.
- update-alternatives: the repo's default branch is master, not main, so
  git ls-remote returned nothing; also add use_commit since the repo has
  no tags at all.
- zlib-ng/lib32-zlib-ng: include_regex is matched with re.fullmatch, so
  "^2\." only matched the literal string "2." and never any real tag; fix
  to "^2\..*".
- mesa-git: verified the reported gitlab 500 was a transient upstream
  outage, not a config issue; no change needed.

Verified locally by installing nvchecker and running it against the
config (mesa-git and update-alternatives resolve correctly now; the
GitHub-sourced entries can't be tested from this sandbox due to the
environment's own API proxy restrictions, but the underlying bugs are
confirmed by reading nvchecker's source).

Also update README's Git Hooks Setup section to document prek instead
of lefthook, since no lefthook config exists in the repo (only docs) and
mise.toml already tracks prek as the intended tool; .pre-commit-config.yaml
is the actual hook definition file prek will use.
ELECTRON_DISABLE_SECURITY_WARNINGS=true masked all Electron security
warnings unconditionally, including ones unrelated to what it was meant
to silence. No specific warnings needed a targeted replacement.

T002 (gitoxide optimize.patch) turned out to be unactionable: there is
no gitoxide/ directory, PKGBUILD, or patch in the repo — only mentions
in README.md and TODO.md. Recorded as blocked in PLAN.md rather than
fabricating a fix.
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ REPOSITORY betterleaks yes no no 0.45s
✅ REPOSITORY checkov yes no no 24.01s
✅ REPOSITORY dustilock yes no no 0.05s
✅ REPOSITORY gitleaks yes no no 10.08s
✅ REPOSITORY git_diff yes no no 0.1s
✅ REPOSITORY grype yes no no 55.12s
✅ REPOSITORY kingfisher yes no no 10.11s
✅ REPOSITORY secretlint yes no no 6.21s
✅ REPOSITORY syft yes no no 4.32s
✅ REPOSITORY trivy yes no no 13.77s
✅ REPOSITORY trivy-sbom yes no no 0.31s
✅ REPOSITORY trufflehog yes no no 6.0s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

pkgbuild-lint (filen-desktop) was failing in CI with "SRCINFO file is
required but missing". Hand-generated by matching the field order/format
of other single-package, non-split PKGBUILDs already in the repo (code,
nvidia_oc, smartdns-rs) since makepkg wasn't available to run directly
in this environment; CI's own byte-exact diff against makepkg
--printsrcinfo will confirm or flag any mismatch.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the lefthook git hook runner with prek, updating the repository's documentation and configuration accordingly. It also removes the blanket ELECTRON_DISABLE_SECURITY_WARNINGS environment variable from filen-desktop and resolves several nvchecker configuration issues for dxvk-gplasync, zlib-ng, and update-alternatives. The feedback suggests avoiding the use of <hook-id> as a placeholder in the shell command block within README.md to prevent accidental shell redirection issues if copied directly by a user.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread README.md Outdated

# Skip hooks temporarily
LEFTHOOK=0 git commit -m "message"
SKIP=<hook-id> git commit -m "message"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using <hook-id> as a placeholder in a shell command block can cause unexpected behavior or syntax errors because the < and > characters are interpreted as input/output redirection operators by Bash. Consider using a safe placeholder format like hook-id or quoting it as "hook-id" to prevent shell redirection issues if a user copies and runs the command.

Suggested change
SKIP=<hook-id> git commit -m "message"
SKIP=hook-id git commit -m "message"

Comment thread PLAN.md Outdated

### T001 · Remove ELECTRON_DISABLE_SECURITY_WARNINGS from filen-desktop
`filen-desktop/filen-desktop.sh:11` · medium · security · S · needs:— · blocks:—
`filen-desktop/filen-desktop.sh:11` · medium · security · S · needs:— · blocks:— · **done**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SUGGESTION: Stale line reference after line removal

The backtick reference filen-desktop/filen-desktop.sh:11 points to a line that was removed in this PR. Line 11 now contains export ELECTRON_OVERRIDE_DIST_PATH="/usr/bin/electron@electronversion@" instead of the removed security warning. Consider updating the reference to filen-desktop/filen-desktop.sh (line removed) or similar to avoid confusion when reviewing the current file.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • .github/actions/pkgbuild/Dockerfile - Adds git to the build container's installed packages (no issues)
Incremental Review Notes

The only change since the previously reviewed commit (13491251) is the addition of git to the pacman -Syu package list in .github/actions/pkgbuild/Dockerfile. This is a correct, well-formed change consistent with the existing command and supports PKGBUILDs that clone git sources. No new issues found.

Previous Review Summaries (2 snapshots, latest commit 1349125)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 1349125)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .github/actions/pkgbuild/Dockerfile
  • PLAN.md
  • README.md

Previous review (commit f887460)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
PLAN.md 56 Stale line reference filen-desktop/filen-desktop.sh:11 after the referenced line was removed in this PR
Files Reviewed (6 files)
  • README.md - 0 issues
  • TODO.md - 0 issues
  • nvchecker.toml - 0 issues
  • PLAN.md - 1 issue
  • filen-desktop/filen-desktop.sh - 0 issues
  • filen-desktop/.SRCINFO - 0 issues

Fix these issues in Kilo Cloud


Reviewed by hy3-20260706:free · Input: 161.1K · Output: 1.4K · Cached: 34K

claude added 2 commits July 7, 2026 09:04
The pkgbuild-lint composite action's Dockerfile never installed
pacman-contrib, so updpkgsums was unavailable whenever
validateChecksums: true is set (which lint.yml sets unconditionally for
the whole matrix) — every package hitting that check would fail with
"updpkgsums: command not found", not just filen-desktop.

Also addresses review feedback on this PR:
- README.md: SKIP=<hook-id> uses characters Bash interprets as
  redirection operators; drop the angle brackets (Gemini Code Assist).
- PLAN.md: T001's line-11 reference is stale now that the referenced
  line was removed (Gemini Code Assist, Kilo Code).
archlinux:base-devel no longer bundles git, so updpkgsums couldn't clone
filen-desktop's git+ source to compute checksums ("git: command not
found"). Same root cause class as the missing pacman-contrib fix: any
git+-sourced package hitting validateChecksums would fail the same way.
@Ven0m0 Ven0m0 merged commit 3faa685 into main Jul 7, 2026
10 of 11 checks passed
@Ven0m0 Ven0m0 deleted the claude/todo-implementation-8twsht branch July 7, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants