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 #402

Closed
chadrik opened this issue Jul 11, 2018 · 2 comments · Fixed by #1875
Closed

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

chadrik opened this issue Jul 11, 2018 · 2 comments · Fixed by #1875
Labels
T: enhancement New feature or request

Comments

@chadrik
Copy link

chadrik commented Jul 11, 2018

Because of this issue pre-commit/identify#51

For now I can solve this by overriding files and types in .pre-commit-config.yaml:

repos:
  - repo: https://github.com/ambv/black
    rev: 18.6b4
    hooks:
      - id: black
        language_version: python3.6
        files: \.pyi?$
        types: []

I would recommend that black use files instead of types until this issue is resolved in identify and pre-commit.

Operating system: osx
Python version: 3.6
Black version: 18.6b4
Does also happen on master: yep

@asottile
Copy link
Contributor

👋 hi again :)

probably best for black to stick to types: [python] so it matches shebang'd files until pre-commit/pre-commit#607 is implemented :)

@zsol zsol added the T: enhancement New feature or request label Jul 19, 2018
@zsol
Copy link
Collaborator

zsol commented Jul 19, 2018

I tend to agree with @asottile here. Sounds like once pre-commit/pre-commit#607 is done, we should add types: [python, pyi] (or whatever else comes out of that PR) to our pre-commit-hooks.yaml

cooperlees pushed a commit that referenced this issue Dec 31, 2020
Since pre-commit 2.9.0 (2020-11-21), the types_or key can be used to
match multiple disparate file types. For more upstream details, see:
pre-commit/pre-commit#607

Add the minimum_pre_commit_version to require pre-commit 2.9.0+.

Fixes #402
noxan pushed a commit to noxan/black that referenced this issue Jun 6, 2021
Since pre-commit 2.9.0 (2020-11-21), the types_or key can be used to
match multiple disparate file types. For more upstream details, see:
pre-commit/pre-commit#607

Add the minimum_pre_commit_version to require pre-commit 2.9.0+.

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

Successfully merging a pull request may close this issue.

3 participants