Skip to main content

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


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.14.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylint_protobuf-0.14.1-py2.py3-none-any.whl (16.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pylint-protobuf-0.14.1.tar.gz.

File metadata

  • Download URL: pylint-protobuf-0.14.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2

File hashes

Hashes for pylint-protobuf-0.14.1.tar.gz
Algorithm Hash digest
SHA256 0eb8fd63b23d2ddec3840754671b74380896c1858eb27915f575281579d5a324
MD5 8dbfe28c92394cb6fd1cdc615328495a
BLAKE2b-256 0ec2cf166a02b1756369feffa8417bf6ae980dd545d69345492f97c19261eb4a

See more details on using hashes here.

File details

Details for the file pylint_protobuf-0.14.1-py2.py3-none-any.whl.

File metadata

  • Download URL: pylint_protobuf-0.14.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2

File hashes

Hashes for pylint_protobuf-0.14.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6b0ac469b43fb82cd8b24be28969c6c6482629d41c77946dbbf2267815a0f69b
MD5 91ed8fc0df2adf683e6f211e2641e3e8
BLAKE2b-256 8613df629b40a1ed7b197de2a89c21e194acd5adf1ca387c44aa3518519d7d3b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page