A plugin for making Pylint aware of the fields of protobuf-generated classes
Project description
pylint-protobuf
pylint-protobuf
is a Pylint plugin for making Pylint aware of generated
fields from Protobuf types.
Usage
$ cat <<EOF >person.proto
message Person {
required string name = 1;
required int32 id = 2;
optional string email = 3;
}
EOF
$ cat <<EOF >example.py
from person_pb2 import Person
a = Person()
a.invalid_field = 123
EOF
$ protoc person.proto --python_out=.
$ pip install pylint-protobuf
$ pylint --load-plugin=pylint_protobuf example.py
************* Module example
E: 4, 0: Field 'invalid_field' does not appear in the declared fields of
protobuf-generated class 'Person' and will raise AttributeError on access
(protobuf-undefined-attribute)
------------------------------------
Your code has been rated at -6.67/10
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pylint_protobuf-0.3.dev3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3b3d14fed4e8224b9866a35470a4d7ebe3b444ffc3a5ba6002e0b4c42eeb283 |
|
MD5 | 4204c1a4f36bbf34660dd41ff3e8fcf0 |
|
BLAKE2b-256 | 089d213be67f50d153ff8802981393dccbe838296f7b0a38d4542227b39414dc |