Enable black and pylint in tox, and update code accordingly