Skip to content

Commit

Permalink
docs: add commit parser docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mariugul committed Sep 20, 2024
1 parent fa0aaa3 commit 79e1675
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 18 additions & 0 deletions docs/source/commit_parser.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Commit Message Parser
======================

Overview
--------
The commit message parser is designed to extract and organize commit message components into a structured format. It identifies the summary, body, and footer from commit messages that follow common conventions.

Features
--------
The commit parser offers several key features. First, it performs summary extraction by capturing the first line of the commit message and designating it as the summary.

Next, it includes body extraction, which collects all lines that follow the summary while excluding any footer lines.

In addition, the parser recognizes and collects footer lines, accommodating special tags such as “BREAKING CHANGE” as well as any user-defined footer labels.

Moreover, the parser effectively handles whitespace, preserving leading and trailing whitespace and newlines to maintain the original formatting of the commit message.

Finally, it incorporates error handling by raising a ValueError when an empty commit message is provided, thus preventing potential processing errors.
3 changes: 2 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ Lint git commits in a Conventional Commits manner in pure Python.
get_started
cli
user_config
rules_config
rules_config
commit_parser

0 comments on commit 79e1675

Please # to comment.