Question about Python Code Styles

Hi there,

We’re implementing additional layer support on Caffe frontend into our internal codebase. And we’re also considering to contribute our code to upstream.

We’ve checked contribution guide and it mentions that it’s required (or better?) to check our code style using make pylint.(Code Guide and Tips — tvm 0.8.dev0 documentation)

However, it doesn’t specify which message types should be fixed and which one can be ignored.

Is there any specific rules for that?

For instance, we got the below pylint messages. Should we fix them? R0914: Too many local variables (21/15) (too-many-locals) R1735: Consider using {} instead of dict() (use-dict-literal) C0121: Comparison 'some_value == True' should be 'some_value is True' if checking for the singleton value True, or 'some_value' if testing for truthiness (singleton-comparison) R1735: Consider using {} instead of dict() (use-dict-literal) R1735: Consider using {} instead of dict() (use-dict-literal)

For linting, you could follow the pylintrc under tests/lint/pylintrc.

For formatting, you just need to run pip3 install black; black -l 100

1 Like

Hi @comaniac,

Thanks for your answer!