Skip to content
New issue

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

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

Already on GitHub? # to your account

IMR241 does not seem to handle custom modules correctly. #14

Closed
AleksandrLiber opened this issue Aug 17, 2023 · 2 comments
Closed

IMR241 does not seem to handle custom modules correctly. #14

AleksandrLiber opened this issue Aug 17, 2023 · 2 comments

Comments

@AleksandrLiber
Copy link

It seems to not be detecting project modules correctly. I did the following to demonstrate the issue

✔  13:35 ~/PycharmProjects/pythonProject $ tree
.
├── main.py
└── test
    ├── __init__.py
    └── test2
        ├── __init__.py
        └── testmodule.py

2 directories, 4 files
✔  13:36 ~/PycharmProjects/pythonProject $ cat main.py 
from test.test2 import testmodule
from test import test2

if __name__ == '__main__':
    testmodule.foo()
    test2.testmodule.foo()
(pythonProject) ✔  13:36 ~/PycharmProjects/pythonProject $ flake8
./main.py:1:1: IMR241 from-import statements must only import modules. (hint: Import the containing module instead.)
./main.py:2:1: IMR241 from-import statements must only import modules. (hint: Import the containing module instead.)

The import is a submodule but it is flagged as an issue

@atollk
Copy link
Owner

atollk commented Aug 25, 2023

Thanks for the report. I'll have a look :)

@atollk atollk mentioned this issue Aug 25, 2023
@atollk atollk closed this as completed Aug 25, 2023
@AleksandrLiber
Copy link
Author

Thank you!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants