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
===============
`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
pylint-protobuf-0.2.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for pylint_protobuf-0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 626a2eec20e6e6fc5d1b756362be32025dd2d6ef976ee88bf58cdc152b619027 |
|
MD5 | 735edc8267a005d93f882f53d08cc20d |
|
BLAKE2b-256 | 8fa5781d0d9047ca920c1f1f168696b13b2b04f9f14b6741ddc2e35a1eea72e9 |