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

Git Lint

Git Lint

A linter and coding buddy for enforcing consistent Git commits. Git Lint ensures you maintain a clean, easy to read, and debuggable project history. Not only does having a tool like this make your code a joy to work with but it also helps you and your team build a wealth of knowledge to fall back on when existing or new members of the team need to understand how the architecture of your system evolved over time.

Brooke Kuhlmann

December 28, 2021
Tweet

More Decks by Brooke Kuhlmann

Other Decks in Programming

Transcript

  1. A Non-Descriptive History 27c7c6211aa1 ok, this works 3a0843a69fd6 Do the

    right thing e00e9ebc358c Simplify 74f9dfdac814 I give up 7eca44a9c9bf hack b3eee2292be7 start
  2. A Non-Descriptive History 27c7c6211aa1 ok, this works 3a0843a69fd6 Do the

    right thing e00e9ebc358c Simplify 74f9dfdac814 I give up 7eca44a9c9bf hack b3eee2292be7 start ⁉ ⁉ ⁉ ⁉ ⁉ ⁉
  3. A Non-Descriptive History 27c7c6211aa1 ok, this works 3a0843a69fd6 Do the

    right thing e00e9ebc358c Simplify 74f9dfdac814 I give up 7eca44a9c9bf hack b3eee2292be7 start ⁉ ⁉ ⁉ ⁉ ⁉ ⁉ 🚫
  4. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest.
  5. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest. Subject
  6. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest. Subject (what)
  7. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest. Subject Body (what)
  8. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest. Subject Body (what) (why)
  9. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest.
  10. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest. Fixed Added Updated Removed Refactored
  11. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest.
  12. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest. 72 characters
  13. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest. Space
  14. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest. Capitalization
  15. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest. 72 characters
  16. Anatomy of a Good Commit Added table of contents to

    README Received feedback that the README was hard to navigate. With a Table of Contents, people are able to quickly scan what the README provides and immediately jump to a topic of interest. actually basically furthermore however obviously of course ...etc... 🚫
  17. Readable Git History Added gem skeleton 📖 📄 Added initial

    architecture and implementation 📄 Added command line interface 📄 Refactored private API 📄 Updated README table of contents 📄
  18. Getting Started gem install git-lint Installation: git switch <branch> Usage:

    git-lint --analyze https://www.alchemists.io/projects/git-lint
  19. Git Hook Support .git/hooks/commit-msg 📄 set -o nounset set -o

    errexit set -o pipefail IFS=$'\n\t' #! /usr/bin/env bash https://www.alchemists.io/projects/git-lint
  20. Git Hook Support .git/hooks/commit-msg 📄 set -o nounset set -o

    errexit set -o pipefail IFS=$'\n\t' if ! command -v git-lint > /dev/null; then printf "%s\n" "[git]: Git Lint not found. To install, run: gem install git-lint." exit 1 f #! /usr/bin/env bash https://www.alchemists.io/projects/git-lint
  21. Git Hook Support .git/hooks/commit-msg 📄 set -o nounset set -o

    errexit set -o pipefail IFS=$'\n\t' if ! command -v git-lint > /dev/null; then printf "%s\n" "[git]: Git Lint not found. To install, run: gem install git-lint." exit 1 f git-lint --hook "${BASH_ARGV[0]}" ⭐ #! /usr/bin/env bash https://www.alchemists.io/projects/git-lint
  22. Git Hook Support .git/hooks/commit-msg 📄 set -o nounset set -o

    errexit set -o pipefail IFS=$'\n\t' if ! command -v git-lint > /dev/null; then printf "%s\n" "[git]: Git Lint not found. To install, run: gem install git-lint." exit 1 f git-lint --hook "${BASH_ARGV[0]}" ⭐ #! /usr/bin/env bash https://www.alchemists.io/projects/git-lint
  23. Git Hook Support .git/hooks/commit-msg 📄 set -o nounset set -o

    errexit set -o pipefail IFS=$'\n\t' if ! command -v git-lint > /dev/null; then printf "%s\n" "[git]: Git Lint not found. To install, run: gem install git-lint." exit 1 f git-lint --hook "${BASH_ARGV[0]}" ⭐ #! /usr/bin/env bash https://www.alchemists.io/projects/git-lint
  24. Git Commit Work fl ow git commit Did some stu

    ff fi nished discussed work 📄 https://www.alchemists.io/projects/git-lint
  25. Git Commit Work fl ow git commit Did some stu

    ff fi nished discussed work 📄 Subject https://www.alchemists.io/projects/git-lint
  26. Git Commit Work fl ow git commit Did some stu

    ff fi nished discussed work 📄 Subject Body https://www.alchemists.io/projects/git-lint
  27. Git Commit Work fl ow git commit Did some stu

    ff fi nished discussed work 📄 🚫 https://www.alchemists.io/projects/git-lint
  28. Git Commit Work fl ow git commit Did some stu

    ff fi nished discussed work 📄 8790d748e650 (Brooke Kuhlmann, 0 seconds ago): Did some stu ff Commit Body Leading Line Error. Use blank line between subject and body. Commit Body Paragraph Capitalization Error. Capitalize fi rst word. Line 2: " fi nished discussed work" Commit Subject Pre fi x Error. Use: /Fixed/, /Added/, /Updated/, /Removed/, /Refactored/. 1 commit inspected. 3 issues detected (0 warnings, 3 errors). 🚫 https://www.alchemists.io/projects/git-lint
  29. Git Commit Work fl ow git commit Did some stu

    ff fi nished discussed work 📄 8790d748e650 (Brooke Kuhlmann, 0 seconds ago): Did some stu ff Commit Body Leading Line Error. Use blank line between subject and body. Commit Body Paragraph Capitalization Error. Capitalize fi rst word. Line 2: " fi nished discussed work" Commit Subject Pre fi x Error. Use: /Fixed/, /Added/, /Updated/, /Removed/, /Refactored/. 1 commit inspected. 3 issues detected (0 warnings, 3 errors). 🚫 https://www.alchemists.io/projects/git-lint
  30. Git Commit Work fl ow git commit Did some stu

    ff fi nished discussed work 📄 8790d748e650 (Brooke Kuhlmann, 0 seconds ago): Did some stu ff Commit Body Leading Line Error. Use blank line between subject and body. Commit Body Paragraph Capitalization Error. Capitalize fi rst word. Line 2: " fi nished discussed work" Commit Subject Pre fi x Error. Use: /Fixed/, /Added/, /Updated/, /Removed/, /Refactored/. 1 commit inspected. 3 issues detected (0 warnings, 3 errors). 🚫 https://www.alchemists.io/projects/git-lint
  31. Git Commit Work fl ow git commit Did some stu

    ff fi nished discussed work 📄 8790d748e650 (Brooke Kuhlmann, 0 seconds ago): Did some stu ff Commit Body Leading Line Error. Use blank line between subject and body. Commit Body Paragraph Capitalization Error. Capitalize fi rst word. Line 2: " fi nished discussed work" Commit Subject Pre fi x Error. Use: /Fixed/, /Added/, /Updated/, /Removed/, /Refactored/. 1 commit inspected. 3 issues detected (0 warnings, 3 errors). 🚫 https://www.alchemists.io/projects/git-lint
  32. Git Commit Work fl ow git commit Did some stu

    ff fi nished discussed work 📄 8790d748e650 (Brooke Kuhlmann, 0 seconds ago): Did some stu ff Commit Body Leading Line Error. Use blank line between subject and body. Commit Body Paragraph Capitalization Error. Capitalize fi rst word. Line 2: " fi nished discussed work" Commit Subject Pre fi x Error. Use: /Fixed/, /Added/, /Updated/, /Removed/, /Refactored/. 1 commit inspected. 3 issues detected (0 warnings, 3 errors). 🚫 https://www.alchemists.io/projects/git-lint
  33. Git Commit Work fl ow git commit Did some stu

    ff fi nished discussed work 📄 8790d748e650 (Brooke Kuhlmann, 0 seconds ago): Did some stu ff Commit Body Leading Line Error. Use blank line between subject and body. Commit Body Paragraph Capitalization Error. Capitalize fi rst word. Line 2: " fi nished discussed work" Commit Subject Pre fi x Error. Use: /Fixed/, /Added/, /Updated/, /Removed/, /Refactored/. 1 commit inspected. 3 issues detected (0 warnings, 3 errors). 🚫 https://www.alchemists.io/projects/git-lint
  34. Customizable Con fi guration Analyzers • Commit Author • Commit

    Body • Commit Subject • Commit Trailer https://www.alchemists.io/projects/git-lint
  35. Customizable Con fi guration Analyzers • Commit Author • Commit

    Body • Commit Subject • Commit Trailer Enablement ✅ On 🚫 Off https://www.alchemists.io/projects/git-lint
  36. Customizable Con fi guration Analyzers • Commit Author • Commit

    Body • Commit Subject • Commit Trailer Severity ⚠ Warning ❌ Error Enablement ✅ On 🚫 Off https://www.alchemists.io/projects/git-lint
  37. Customizable Con fi guration Analyzers • Commit Author • Commit

    Body • Commit Subject • Commit Trailer Severity ⚠ Warning ❌ Error Enablement ✅ On 🚫 Off Regular Expressions ⭐ https://www.alchemists.io/projects/git-lint