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-plugins=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
Supported Python Versions
pylint-protobuf
supports Python 3.5 at a minimum.
Known Issues
pylint-protobuf
does not currently support the following concepts from the protobuf specification:
oneof
fields- repeated fields
- TypeError on field assignment
Externally defined message types are currently uninferable and so checking fields on message types may fail.
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
pylint-protobuf-0.16.0.tar.gz
(9.9 kB
view hashes)
Built Distribution
Close
Hashes for pylint_protobuf-0.16.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96741399d60f2e9c4e6470ab85b571867d0cc6c45dddb8f837470c0474f51cca |
|
MD5 | e635e45f55b36e3a45a3cff97e23be0d |
|
BLAKE2b-256 | 8e8c28bcbd0a7a1579bb98e2faeedbd2986bf0e89eb2eb150e98745d23003785 |