seddonym / import-linter

Import Linter allows you to define and enforce rules for the internal and external imports within your Python project.
https://import-linter.readthedocs.io/
BSD 2-Clause "Simplified" License
664 stars 45 forks source link

Noisy logging warnings about 'skipping module with too many dots in the name' #211

Closed jogo closed 8 months ago

jogo commented 8 months ago

When trying to use import-linter on a large messy repo we get lots of warnings such as Warning: skipping module with too many dots in the name /home/user/foo/bar/docker-compose.base.yml which appear to be generated from https://github.com/seddonym/grimp/blob/88d49122dd66fe6d092a69a5e8a302e667e908d1/src/grimp/adaptors/modulefinder.py#L80

Q: Is it possible to tell import-linter to only check files with the .py suffix or perhaps another route to opt into silencing these warnings?

Also, thank you for this wonderful tool.

seddonym commented 8 months ago

Thanks for the bug report - yes this is noise, we should only log the warning for Python files. If you feel like submitting a pull request then please do, otherwise I'll get around to it!

seddonym commented 8 months ago

I've made the bug fix, which I plan to release on the upstream library (Grimp) early next week. Fixing it here shouldn't be too far behind.

seddonym commented 8 months ago

This is now fixed in version 2.0. Let me know if any issues, and thanks again for reporting.