Skip to content

sterliakov/pre-commit

 
 

Repository files navigation

A fork of pre-commit with experimental workdir setting support.

Using this fork, you can configure some hooks to run "as-if" the selected subfolders were in repository root.

E.g., with the following directory structure:

.
├── .git
├── backend
│   ├── pyproject.toml
│   └── uv.lock
├── frontend
│   ├── package.json
│   ├── pnpm-lock.yaml
│   ├── biome.jsonc
│   ├── src
│   ├── tsconfig.json
│   └── vite.config.js
└── .pre-commig-config.yaml

the following file will find backend-related and frontend-related files correctly:

repos:
-   repo: https://github.com/astral-sh/uv-pre-commit
    rev: 0.4.24
    hooks:
    -   id: uv-lock
        workdir: backend

-   repo: https://github.com/biomejs/pre-commit
    rev: "v0.5.0"
    hooks:
    -   id: biome-check
        additional_dependencies: ["@biomejs/biome"]
        language_version: "20.18.0"
        workdir: frontend

About

A framework for managing and maintaining multi-language pre-commit hooks.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 97.3%
  • R 2.1%
  • Shell 0.5%
  • Dockerfile 0.1%
  • Lua 0.0%
  • Ruby 0.0%