Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move .pre-commit.yaml to hatch #51

Open
benoit74 opened this issue Nov 7, 2024 · 3 comments
Open

Move .pre-commit.yaml to hatch #51

benoit74 opened this issue Nov 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@benoit74
Copy link
Collaborator

benoit74 commented Nov 7, 2024

See openzim/devdocs#37 (comment)

@rgaudin
Copy link
Member

rgaudin commented Nov 7, 2024

If that's possible, that would be great indeed!

@josephlewis42
Copy link
Contributor

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

@benoit74
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants