이 글은 pre-commit hook 을 사용하고 전파하기 위해 작성한 시리즈 글입니다.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 19.3b0
hooks:
- id: black
pre-commit install
pre-commit run --all-files
pre-commit
훅이 걸릴 것임. 오후 1:54 Commit failed with error
0 file committed, 5 files failed to commit: feat: pre-commit hook 추가
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
black....................................................................Failed
- hook id: black
- files were modified by this hook
reformatted /home/l4in/garage.object/01_객체,설계/01_대충설계한코드/audience.py
reformatted /home/l4in/garage.object/01_객체,설계/01_대충설계한코드/bag.py
All done! ✨ 🍰 ✨
2 files reformatted, 3 files left unchanged.
mypy.....................................................................Failed
- hook id: mypy
- exit code: 2
01_대충설계한코드 is not a valid Python package name