Skip to content

Conversation

@Bibo-Joshi
Copy link
Member

We recently switched to Black formatting to increase code quality and I thought it would be good to also tighten the other precommit hooks. This PR

  • makes MyPy run also on the examples
  • removes the current behaviour of pylint to show only errors and ignore import erros

TBH the result turned out to be not as great as I had hoped :D Most of the pylint complains that arose I simply disabled either on that very line, some on module level and a bunch globally. I did some improvements like

  • complying with snail_snake naming
  • using lazy string thingies for logging
  • removing unneccessary elifs after returns
  • rearranging imports

IMO this PR still helps improve code quality as it

  • acutally improves the code quality in some places
  • ignores warnings/erros more fine-grained which leads to future PRs
    • PRs having to either code better or at least think about if it's okay to ignore a warning
    • having the chance to improve code that has # pylint: disable= comments. Currently you just don't know that there are warnings.

But of course the benefit is not arbitrarily high, so I'd be okay with closing if the the other devs don't see the value of this PR :)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hey there. Relax, I am just a little warning for the maintainers to release directly after merging your PR, otherwise we have broken examples and people might get confused :)

Note: I just added type hinting and did some renaming. So we're good.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hey there. Relax, I am just a little warning for the maintainers to release directly after merging your PR, otherwise we have broken examples and people might get confused :)

# Conflicts:
#	telegram/chat.py
#	telegram/chatmember.py
#	telegram/dice.py
#	telegram/files/sticker.py
#	telegram/messageentity.py
#	telegram/poll.py
# Conflicts:
#	examples/timerbot.py
#	telegram/chat.py
#	telegram/chatmember.py
#	telegram/dice.py
#	telegram/ext/basepersistence.py
#	telegram/ext/conversationhandler.py
#	telegram/files/sticker.py
#	telegram/message.py
#	telegram/messageentity.py
#	telegram/poll.py
# Conflicts:
#	telegram/user.py
#	tests/test_conversationhandler.py
# Conflicts:
#	telegram/ext/filters.py
@Bibo-Joshi Bibo-Joshi merged commit 92b9370 into master Oct 31, 2020
@Bibo-Joshi Bibo-Joshi deleted the tighten-pre-commit branch October 31, 2020 15:33
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants