Skip to content

feat: add pre-commit hooks and codecov config - #145

Open
Kallyan01 wants to merge 1 commit into
feat/ai-optimized-scaffoldfrom
feat/hooks-codecov
Open

Kallyan01 wants to merge 1 commit into
feat/ai-optimized-scaffoldfrom
feat/hooks-codecov

Conversation

@Kallyan01

@Kallyan01 Kallyan01 commented Aug 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add pre-commit hooks and Codecov configuration, bringing OneDesign onto the
shared OneSearch dev baseline. Dependabot is already configured in this repo,
so no changes were needed there.

Changes

  • .lefthook.yml (new): pre-commit hook that runs lint-staged.
  • .lintstagedrc.mjs (new): staged-file linting — wp-scripts lint-js --fix
    for JS/TS, wp-scripts lint-style --fix for CSS/SCSS, phpcbf for PHP, and a
    wp-scripts format pass. The PHP command is wrapped in
    sh -c "… || [ $? -eq 3 ]" so that phpcbf's exit code 3 ("fixes applied") is
    treated as success rather than failure.
  • .github/.codecov.yml (new): informational project (70%) and patch (60%)
    targets, plus the fixes: path rewrite from the wp-env container path
    /var/www/html/wp-content/plugins/onedesign/ to repo-relative. Without this,
    reusable-phpunit.yml and reusable-jest.yml already upload coverage with
    CODECOV_TOKEN but no path mapping, so Codecov reports the wrong paths.
  • package.json: adds prepare: lefthook install and the lefthook /
    lint-staged devDependencies. The lockfile update is purely additive
    (+239 lines, no existing dependency re-resolved).

@Kallyan01
Kallyan01 requested a review from justlevine August 19, 2026 09:14
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.

1 participant