This repository was archived by the owner on Jul 3, 2024. It is now read-only.
Enable linting of stub files (.pyi) in pre-commit hook#77
Open
Apakottur wants to merge 1 commit intoMarcoGorelli:mainfrom
Open
Enable linting of stub files (.pyi) in pre-commit hook#77Apakottur wants to merge 1 commit intoMarcoGorelli:mainfrom
.pyi) in pre-commit hook#77Apakottur wants to merge 1 commit intoMarcoGorelli:mainfrom
Conversation
Enable support for `pyi` files when using `absolufy-imports` through `pre-commit`. This will run absolufy-imports on stub files in addition to source files. References: 1. [The same file on black](https://github.com/psf/black/blob/main/.pre-commit-hooks.yaml) 2. [pre-commit docs](https://github.com/psf/black/blob/main/.pre-commit-hooks.yaml) 3. [Same PR on pyupgrade](asottile/pyupgrade#771)
This was referenced Dec 21, 2022
Owner
|
sorry, closed by accident should be good, thanks @Apakottur , tried this out on pandas and it worked fine |
Codecov Report
@@ Coverage Diff @@
## main #77 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 102 102
=========================================
Hits 102 102 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Author
|
Note that the PRs on flake8/pyupgrade were not accepted, as the authors did not want to support pyi by default. |
Owner
|
I think it should be fine here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable support for
pyifiles when usingabsolufy-importsthroughpre-commit. This will run absolufy-imports on stub files in addition to source files.References: