Talk Python To Me

#482: Pre-commit Hooks for Python Devs

12 snips
Oct 24, 2024
Stefanie Molin, a software engineer at Bloomberg renowned for her expertise in Git pre-commit hooks, shares invaluable insights on ensuring code quality. She discusses the power of pre-commit hooks for automating coding standards, particularly the NumPy doc standard. Stefanie highlights the importance of maintaining consistency in team workflows and dives into practical setups for effective linting. With tips on Commitizen and CI integration, she emphasizes boosting developer productivity while addressing data privacy in image uploads.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ANECDOTE

NumPyDoc and Pre-commit Hooks

  • Stefanie Molin's team wanted consistent docstrings.
  • A pre-commit hook could have prevented trailing whitespace errors, prompting her to explore them.
ADVICE

Automating Code Style

  • Integrate coding style tools for consistency.
  • Automate them with pre-commit hooks or IDE extensions to ensure adherence.
INSIGHT

How Pre-commit Hooks Work

  • Git hooks are triggered by actions like commits or pushes.
  • Pre-commit hooks specifically run before a commit is finalized, preventing incorrect code from being committed.
Get the Snipd Podcast app to discover more snips from this episode
Get the app