Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a .pylintrc & fix warnings #24

Merged
merged 3 commits into from
Jun 25, 2019

Conversation

Oberon00
Copy link
Member

This is based on opencensus/opencensus-python#667, with one major difference: I emptied the disabled checks and only re-disabled a few select ones. I also commented out a few settings that I believe were equal to the default anyway. Of course, I also fixed the issues pylint already found and added a dev-requirements.txt that can be used to install the right pylint version.

One thing I'm not sure about is the "W0107: Unnecessary pass statement (unnecessary-pass)" warning. When a function has a docstring, the pass-statement is not required anymore but I guess you could argue that the resulting code is odd. Still, it removes a few lines so I heeded the warning for now. What do you think?

@Oberon00 Oberon00 self-assigned this Jun 24, 2019
Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

It is interesting to know that pass statement is not required (and recommended be to removed) when there is a docstring :)

Copy link
Member

@c24t c24t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, and re-disabling checkers when they give us spurious errors seems like the right approach to me.

@@ -68,7 +68,7 @@
from typing import Iterator


class Tracer(object):
class Tracer:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI there's a subtle difference here. The old version lets you monkey patch builtins.object: https://stackoverflow.com/a/45893772. But that seems like a feature we're better off without...

@c24t
Copy link
Member

c24t commented Jun 24, 2019

When a function has a docstring, the pass-statement is not required anymore [...] What do you think?

👍 to losing pass.

@Oberon00 Oberon00 merged commit 5d1632a into open-telemetry:master Jun 25, 2019
@c24t c24t mentioned this pull request Jun 26, 2019
srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this pull request Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants