Date: Sun, 09 Sep 2018 22:00:00 -0400
<h3>Summary</h3> <p>Maintaining the health and well-being of your software is a never-ending responsibility. Automating away as much of it as possible makes that challenge more achievable. In this episode Anthony Sottile describes his work on the pre-commit framework to simplify the process of writing and distributing functions to make sure that you only commit code that meets your definition of clean. He explains how it supports tools and repositories written in multiple languages, enforces team standards, and how you can start using it today to ship better software.</p> <h3>Preface</h3> <ul> <li>Hello and welcome to Podcast.__init__, the podcast about Python and the people who make it great.</li> <li>When you’re ready to launch your next app you’ll need somewhere to deploy it, so check out Linode. With private networking, shared block storage, node balancers, and a 40Gbit network, all controlled by a brand new API you’ve got everything you need to scale up. Go to <a href="https://www.pythonpodcast.com/linode?utm_source=rss&utm_medium=rss">podcastinit.com/linode</a> to get a $20 credit and launch a new server in under a minute.</li> <li>Visit the <a href="https://www.pythonpodcast.com?utm_source=rss&utm_medium=rss">site</a> to subscribe to the show, sign up for the newsletter, and read the show notes. And if you have any questions, comments, or suggestions I would love to hear them. You can reach me on Twitter at <a href="https://twtiter.com/podcastinit?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">@Podcast__init__</a> or email <a href="mailto:hosts@podcastinit.com">hosts@podcastinit.com</a>)</li> <li>To help other people find the show please leave a review on <a href="https://itunes.apple.com/us/podcast/podcast.-init/id981834425?mt=2&uo=6&at=&ct=&utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">iTunes</a>, or <a href="https://play.google.com/music/m/I7ogju4xv6adasgqz6545jndgsy?t=Podcastinit_-_Python_and_the_people_who_make_it_great&utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Google Play Music</a>, tell your friends and co-workers, and share it on social media.</li> <li>Join the community in the new Zulip chat workspace at <a href="https://www.pythonpodcast.com/chat?utm_source=rss&utm_medium=rss">podcastinit.com/chat</a></li> <li>Your host as usual is Tobias Macey and today I’m interviewing Anthony Sottile about pre-commit, a framework for managing and maintaining hooks for multiple languages</li> </ul> <h3>Interview</h3> <ul> <li>Introductions</li> <li>How did you get introduced to Python?</li> <li>Can you start by describing what a pre-commit hook is and some of the ways that they are useful for developers?</li> <li>What was you motivation for creating a framework to manage your pre-commit hooks? <ul> <li>How does it differ from other projects built to manage these hooks?</li> </ul> </li> <li>What are the steps for getting someone started with pre-commit in a new project?</li> <li>Which other event hooks would be most useful to implement for maintaining the health of a repository?</li> <li>What types of operations are most useful for ensuring the health of a project?</li> <li>What types of routines should be avoided as a pre-commit step?</li> <li>Installing the hooks into a user’s local environment is a manual step, so how do you ensure that all of your developers are using the configured hooks? <ul> <li>What factors have you found that lead to developers skipping or disabling hooks?</li> </ul> </li> <li>How is pre-commit implemented and how has that design evolved from when you first started? <ul> <li>What have been the most difficult aspects of supporting multiple languages and package managers?</li> <li>What would you do differently if you started over today?</li> <li>Would you still use Python?</li> </ul> </li> <li>For someone who wants to write a plugin for pre-commit, what are the steps involved?</li> <li>What are some of the strangest or most unusual uses of pre-commit hooks that you have seen?</li> <li>What are your plans for the future of pre-commit?</li> </ul> <h3>Keep In Touch</h3> <ul> <li><a href="https://github.com/asottile?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">asottile</a> on GitHub</li> <li><a href="https://twitter.com/codewithanthony?lang=en&utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">@codewithanthony</a> on Twitter</li> <li><a href="https://www.twitch.tv/anthonywritescode?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">anthonywritescode</a> on twitch</li> <li><a href="https://www.youtube.com/channel/UC46xhU1EH7aywEgvA9syS3w?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">anthonywritescode</a> on YouTube</li> </ul> <h3>Picks</h3> <ul> <li>Tobias <ul> <li><a href="https://www.imdb.com/title/tt2854926/?ref_=nv_sr_1&utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Tag</a></li> </ul> </li> <li>Anthony <ul> <li><a href="https://www.youtube.com/channel/UCvK4bOhULCpmLabd2pDMtnA?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Yes Theory</a></li> </ul> </li> </ul> <h3>Links</h3> <ul> <li><a href="https://pre-commit.com/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">pre-commit</a> <ul> <li><a href="https://pre-commit.com/hooks.html?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">List of hooks</a></li> </ul> </li> <li><a href="https://www.lyft.com/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Lyft</a> <ul> <li><a href="https://www.lyft.com/careers?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Careers</a></li> </ul> </li> <li><a href="https://en.wikipedia.org/wiki/Git?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Git</a></li> <li><a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Git hooks</a> <ul> <li><a href="https://githooks.com/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">https://githooks.com/?utmsource=rss&utmmedium=rss</a></li> </ul> </li> <li><a href="http://flake8.pycqa.org/en/latest/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Flake8</a></li> <li><a href="https://linux.die.net/man/1/make?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Make</a></li> <li><a href="https://tox.readthedocs.io/en/latest/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Tox</a></li> <li><a href="https://mypy.readthedocs.io/en/latest/getting_started.html?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Type Annotations</a></li> <li><a href="http://man7.org/linux/man-pages/man1/xargs.1.html?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">xargs</a></li> <li><a href="https://linux.die.net/man/1/bash?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Bash</a></li> <li><a href="https://docs.python.org/3/library/shlex.html?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">shlex</a></li> </ul> <p>The intro and outro music is from Requiem for a Fish <a href="http://freemusicarchive.org/music/The_Freak_Fandango_Orchestra/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">The Freak Fandango Orchestra</a> / <a href="http://creativecommons.org/licenses/by-sa/3.0/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">CC BY-SA</a><img alt="" height="0" src="https://analytics.boundlessnotions.com/piwik.php?idsite=1&rec=1&url=https%3A%2F%2Fwww.pythonpodcast.com%2Fpre-commit-with-anthony-sottile-episode-178%2F&action_name=Keep+Your+Code+Clean+Using+pre-commit+with+Anthony+Sottile+-+Episode+178&urlref=https%3A%2F%2Fwww.pythonpodcast.com%2Ffeed%2F&utm_source=rss&utm_medium=rss" style="border: 0; width: 0; height: 0;" width="0" /></p>