-
Notifications
You must be signed in to change notification settings - Fork 0
feat: define comprehensive token types for commit message compiler #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: define comprehensive token types for commit message compiler #76
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||||||||
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
PR Type
Enhancement
Description
Replaced empty token enum with comprehensive Token variants for conventional commits
Added Type, Scope, Breaking, Description, Body, Footer, Newline, and Eof token types
Implemented utility methods: type_name(), value(), is_breaking(), is_newline(), is_eof()
Added Display trait implementation and extensive test coverage for all token types
Diagram Walkthrough
File Walkthrough
token.rs
Implement comprehensive Token enum with methods and testssrc/compiler/token.rs
TokenKindenum andTokenstruct with a comprehensiveTokenenum containing 8 variants representing different parts ofconventional commit messages
type_name()for human-readable token typenames,
value()to extract string content, and three boolean predicates(
is_breaking(),is_newline(),is_eof())Displaytrait implementation with truncation for longdescriptions and body text
names, value extraction, predicates, display formatting, cloning, and
equality comparisons