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

pre-commit hook does not work for .pyi files #103

Closed
proofit404 opened this issue Oct 10, 2019 · 3 comments
Closed

pre-commit hook does not work for .pyi files #103

proofit404 opened this issue Oct 10, 2019 · 3 comments

Comments

@proofit404
Copy link

Hi, thanks for the awesome project!

It very similar to psf/black#402

As a workaround, I use a similar approach with files and empty types.

  - repo: https://github.com/asottile/reorder_python_imports
    rev: ''
    hooks:
      - id: reorder-python-imports
        args: [--application-directories=.:src:tests/helpers]
        exclude: migrations
        files: \.pyi?$
        types: []

Have a good day 🎉

Best regards,
Artem.

@asottile
Copy link
Owner

yeah the eventual plan is to extend pre-commit to support types_or via pre-commit/pre-commit#607

@asottile
Copy link
Owner

closing since there's a workaround and nothing to do for now -- but maybe once there's a proper proposal in that issue this'll move forward!

@Greedquest
Copy link

Greedquest commented May 17, 2022

@asottile Sorry this is closed but I'm confused, now that pre-commit/pre-commit#607 has been resolved, what's the best way to do this and get the hook to run on .pyi files?


Based on that linked black thread, it looks like in this repo you just add types_or: [python, pyi] and minimum_pre_commit_version: 2.9.2 to pre-commit-hooks.yaml?

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

No branches or pull requests

3 participants