Open benoit74 opened 2 weeks ago
If that's possible, that would be great indeed!
I think I've boiled this down to the following for openzim/devdocs, however I'm not a pre-commit or Python tooling expert so there might be missing bits:
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: local
hooks:
- id: "lint"
name: "hatch run lint:all"
entry: hatch
language: system
args: ["run", "lint:all"]
require_serial: true
pass_filenames: false
- id: "pyright"
name: "pyright (hatch)"
description: 'pyright static type checker'
entry: hatch
language: system
'types_or': [python, pyi]
args: ["run", "check:pyright"]
require_serial: true
pass_filenames: false
Thank you. Doesn't this means that tools are ran on all files instead of only modified ones? This would be a bit sad. Using repo: local
is anyway an interesting path to follow.
See https://github.com/openzim/devdocs/pull/37#discussion_r1832039501