Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Enforcing Code Quality Standards With Git Hooks

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →

Enforcing Code Quality Standards With Git Hooks

The talk associated with this deck highlights some of the typical approaches for enforcing code quality standards as well as talks about where Git hooks can fit into this ecosystem. Additionally, a sample implementation is demoed within the context of a Rails application.

Avatar for Andrew H. Carpenter

Andrew H. Carpenter

September 05, 2018

Other Decks in Programming

Transcript

  1. Traditional Gates • Pre-merge (ie. CI Server) • Pre-save (ie.

    Error “messages” in your editor/IDE) @hefleycarpenter
  2. Pros/Cons of Traditional Gates • Pre-merge • Pros: Typically done

    on a separate server that more closely mimics prod. “Publicly” viewable results. Doesn’t necessarily require setup on submitters end. • Con: Higher latency • Pre-save • Pros: Lowest latency • Cons: Violations are not easily blocked by reviewer. Potentially requires setup on the submitters end. Results are not publicly visible @hefleycarpenter
  3. Where Git Hooks Fit In • Right between in terms

    of latency • Pros: great for longer running checks and pseudo- blocking violations. • Cons: Requires setup on submitters end. Results are not publicly visible @hefleycarpenter
  4. Demo of overcommit • Available @ https://github.com/brigade/overcommit • Provides YAML

    based configuration for hook setup • Has a ton of hook options @hefleycarpenter