How to integrate a Python linter with git (bitbucket)

To make this a little more clear than the title I want to add some kind of python linter (basically checking if certain standards are being followed) with git.

The main thing is I want to require python type hints for all functions, and if someone tries to push changes to git without them they would fail.

Anyone have any resources or examples of how one could get this started?