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

Fix many pylint warnings in healthcheck.py #257

Merged
merged 4 commits into from
May 11, 2015

Conversation

vincentbernat
Copy link
Member

Most warnings are fixed. However, some of them are still here:

  • logger is a constant and should be upper-cased. I don't agree with that. I could have imported it from another module (from exabgp.logging import logger) and it would be fine. It is declared at the top level because this is the root logger of the application.
  • The documentation contains two long lines. It seems better to have them like this than to let the user join the lines manually when copy/pasting.
  • The broad exception catch is authorized in PEP8 as is (and therefore ignored)
  • Too many branches/statements. For branches, this is because we implement an automaton and this is the most straightforward way to do it without increasing complexity. For the branches, this is mostly because we should introduce a module to do the hard work but we won't because we want a single script. See the second commit for more on this.

Notably, long lines, space between function name and arguments.
pylint complains about too many branches and statements. Unfortunately,
there is little we can do about that. The number of statements in the
`loop()` function is high because it should be a module of its own but
we want to use a single-contained script which is incompatible with a
module. Internal functions are used to looks like a module but pylint
doesn't care.

The too many branches is here because this is how a finite-state
automaton should be implemented in Python. The automaton is too simple
to warrant the use of distinct functions for each state.
@landscape-bot
Copy link

Code Health
Repository health increased by 0.63% when pulling a8097a3 on vincentbernat:fix/pylint into e49aa92 on Exa-Networks:master.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.93% when pulling 6c08624 on vincentbernat:fix/pylint into e49aa92 on Exa-Networks:master.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.93% when pulling fb9bef0 on vincentbernat:fix/pylint into e49aa92 on Exa-Networks:master.

thomas-mangin added a commit that referenced this pull request May 11, 2015
Fix many pylint warnings in healthcheck.py
@thomas-mangin thomas-mangin merged commit f4952d3 into Exa-Networks:master May 11, 2015
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.

None yet

3 participants