Closed xSAVIKx closed 3 years ago
Hi @xSAVIKx, thanks for the report. I see what you mean, we don't check re-exported names from protobuf modules since the linter checks top-down ("where did this symbol come from") instead of bottom-up ("where are these protobuf classes used"). IIRC there's a guard against checking imports from modules (aliased or otherwise) that don't end in _pb2
, I'll see what the state of the code is around there and how easy it would be to relax that and check nested imports.
This should be fixed in the latest master but hasn't made it into a released version yet
@xSAVIKx, this fix has been release in 0.14. Sorry for the wait! Can you confirm that everything is okay?
I've confirmed on my end that this is fixed, I'll close this issue in a couple of days if there's no update.
@nelfin thx a lot for the fix. It works fine now! I'll close the issue.
To simplify usage of generated Python protos I do export specific messages from the proto package inside
__init__.py
like this:The
_pb2
files themselves are in thethumbnails_proto
package. With such a setup, the plugin is not able to recognize proto definitions.Such a custom init file allows me to import proto definitions like this:
from thumbnails_proto import Operation
instead ofimport thumbnails_proto.thumbnails_pb2 import Operation
.