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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore from ... import * imports in stub files #153

Merged
merged 4 commits into from Jul 13, 2022
Merged

Ignore from ... import * imports in stub files #153

merged 4 commits into from Jul 13, 2022

Conversation

AlexWaygood
Copy link
Contributor

@AlexWaygood AlexWaygood commented Jul 13, 2022

Fixes #152. No tests yet, I have no idea what I'm doing there 馃槄

@hadialqattan
Copy link
Owner

@AlexWaygood no worries bro, actually, the Refactor._refactor unit tests are very complicated and need refactoring 馃槄.

@codeclimate
Copy link

codeclimate bot commented Jul 13, 2022

Code Climate has analyzed commit 8602e84 and detected 0 issues on this pull request.

View more on Code Climate.

@hadialqattan
Copy link
Owner

hadialqattan commented Jul 13, 2022

@AlexWaygood BTW, I've moved the filetype check to another function avoiding unnecessary scan.expand_import_star calls.

(scan.expand_import_star is considered costy because it includes both pathfinding and static file analysis using scan.ImportablesAnalyzer)

@codecov
Copy link

codecov bot commented Jul 13, 2022

Codecov Report

Merging #153 (8602e84) into master (1a03fde) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #153   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           28        28           
  Lines         2822      2826    +4     
=========================================
+ Hits          2822      2826    +4     
Impacted Files Coverage 螖
pycln/utils/refactor.py 100.00% <100.00%> (酶)
tests/test_refactor.py 100.00% <100.00%> (酶)

@hadialqattan
Copy link
Owner

hadialqattan commented Jul 13, 2022

@AlexWaygood I feel that I didn't provide enough context for why I've changed the point where we check for stub files. Please feel free to ask for further clarification.

@AlexWaygood
Copy link
Contributor Author

@AlexWaygood BTW, I've moved the filetype check to another function avoiding unnecessary scan.expand_import_star calls.

(scan.expand_import_star is considered costy because it includes both pathfinding and static file analysis using scan.ImportablesAnalyzer)

Nice! I tried it out on typeshed again, and can confirm the bug is still fixed :)

@hadialqattan
Copy link
Owner

@AlexWaygood BTW, I've moved the filetype check to another function avoiding unnecessary scan.expand_import_star calls.
(scan.expand_import_star is considered costy because it includes both pathfinding and static file analysis using scan.ImportablesAnalyzer)

Nice! I tried it out on typeshed again, and can confirm the bug is still fixed :)

Awesome! I'll merge the PR now!

@hadialqattan hadialqattan merged commit 7e85688 into hadialqattan:master Jul 13, 2022
@AlexWaygood AlexWaygood deleted the pyi branch July 13, 2022 17:48
@AlexWaygood
Copy link
Contributor Author

FYI, typeshed is now using pycln as a pre-commit hook in CI :)

I think it's going to be a big quality-of-life improvement for us!

@hadialqattan
Copy link
Owner

FYI, typeshed is now using pycln as a pre-commit hook in CI :)

I think it's going to be a big quality-of-life improvement for us!

Awesome! Thanks a lot for supporting Pycln.. btw, I'll add typeshed to the notable projects list that uses pycln!

https://github.com/hadialqattan/pycln#used-by

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

Successfully merging this pull request may close these issues.

[BUG] from foo import * imports should be ignored in stub files
2 participants