Hello
I am using DeepSource to analyze a Python project & I’m running into a consistent false positive. It flags an unused import in a module where the import is dynamically accessed at runtime (specifically via globals()
in a plugin loader). While the import appears unused in static analysis, it’s actually critical for the runtime execution.
I’ve tried using the # noqa
and # skipcq
directives, but I’m curious if there’s a better way to tell DeepSource this is a dynamic import context.
I want to keep the benefits of clean linting without having to suppress real warnings across the board. I checked Issues - DeepSource Tableau Course guide related to this and found it quite informative.
Is there a recommended pattern or annotation to handle such dynamic use cases without compromising scan quality? Or is this something best handled through
.deepsource.toml
exclusions?
Thank you !!