Top Banner
Introduction to pre-commit A framework for managing and maintaining multi-language pre-commit hooks. @mozillazg
10

Introduction to pre-commit

Apr 16, 2017

Download

Engineering

mozillazg
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to pre-commit

Introduction to pre-commit

A framework for managing and maintaining multi-language pre-commit hooks.

@mozillazg

Page 2: Introduction to pre-commit

ProblemToo many dirty commits like “fix pep8”

Reviewer unhappy

CI busy

Commit history become ugly

Page 3: Introduction to pre-commit
Page 4: Introduction to pre-commit

Solution

We need a tool.

Discover error before CI

Discover error before push

Page 5: Introduction to pre-commit
Page 6: Introduction to pre-commit
Page 7: Introduction to pre-commit

pre-commit

pip install pre-commit

vim .pre-commit-config.yaml

pre-commit install

Page 8: Introduction to pre-commit

.pre-commit-config.yaml

Page 9: Introduction to pre-commit

More

http://pre-commit.com

Page 10: Introduction to pre-commit

Thank You!