Skip to content

feat: add real-time conventional commit linting#108

Merged
rm-hull merged 5 commits into
mainfrom
feat/conventional-commits
May 23, 2026
Merged

feat: add real-time conventional commit linting#108
rm-hull merged 5 commits into
mainfrom
feat/conventional-commits

Conversation

@rm-hull
Copy link
Copy Markdown
Owner

@rm-hull rm-hull commented May 23, 2026

Integrated go-conventionalcommits to provide instant feedback in the commit view. The UI now validates the message structure against conventional commit standards and checks for line length constraints (50 characters for subject, 72 for body).

Fixes #104

Integrated `go-conventionalcommits` to provide instant feedback in the
commit view. The UI now validates the message structure against
conventional commit standards and checks for line length constraints
(50 characters for subject, 72 for body).
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 23, 2026

TestsPassed ✅SkippedFailed
JUnit Test Report49 ran49 passed0 skipped0 failed
TestResult
JUnit Test Report
com/rm-hull/git-commit-summary/internal/config.TestLoad/Defaults✅ passed
com/rm-hull/git-commit-summary/internal/config.TestLoad/WithEnvironmentVariables✅ passed
com/rm-hull/git-commit-summary/internal/config.TestLoad✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/handle_empty_quoted_strings✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/empty_file,_add_new_properties✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/existing_file,_update_properties✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/doesnt_overwrite_values_if_new_value_is_the_same✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/existing_file,_add_new_and_update_existing✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/preserve_comments_and_other_lines✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/handle_mixed_quoting_styles✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/empty_props,_no_changes✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/properties_with_special_characters✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties✅ passed
com/rm-hull/git-commit-summary/internal/llm_provider.TestNewProvider/GoogleProvider✅ passed
com/rm-hull/git-commit-summary/internal/llm_provider.TestNewProvider/OpenAIProvider✅ passed
com/rm-hull/git-commit-summary/internal/llm_provider.TestNewProvider/UnknownProvider✅ passed
com/rm-hull/git-commit-summary/internal/llm_provider.TestNewProvider✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/NewHistory✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Add_and_Value✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Undo✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Redo✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Undo_at_beginning✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Redo_at_end✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Add_truncates_future_history✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Multiple_Undos_and_Redos✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/tea.KeyMsg_-_CtrlC_in_showSpinner_state✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/tea.KeyMsg_-_CtrlC_in_other_states✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/gitCheckMsg_-_empty_(no_staged_changes)✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/gitCheckMsg_-_non-empty_(staged_changes)✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/gitDiffMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/llmResultMsg_-_with_user_message✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/llmResultMsg_-_without_user_message✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/commitMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/regenerateMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/userResponseMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/cancelRegenPromptMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/errMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/abortMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/spinner.Update_for_showSpinner_state✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/commitView.Update_for_showCommitView_state✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/promptView.Update_for_showRegeneratePrompt_state✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/llmResultMsg_-_YOLO_mode✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/llmResultMsg_-_YOLO_mode_-_empty_summary✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update✅ passed
com/rm-hull/git-commit-summary/internal/version.TestCheckLatestReturnsLatestWhenNewer✅ passed
com/rm-hull/git-commit-summary/internal/version.TestCheckLatestReturnsEmptyWhenUpToDate✅ passed
com/rm-hull/git-commit-summary/internal/version.TestCheckLatestReturnsEmptyForDevel✅ passed
com/rm-hull/git-commit-summary/internal/version.TestCheckLatestReturnsErrorOnBadStatus✅ passed

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements commit message linting using the go-conventionalcommits library, enforcing length constraints on subject and body lines within the UI. Feedback highlights a critical syntax error in the uintPtr function and a potential runtime panic in the border rendering logic due to unchecked padding calculations. Recommendations were also made to use character width instead of byte length for validation and to improve the robustness of error parsing from the linting library.

Comment thread internal/ui/commit_view.go
Comment thread internal/ui/commit_view.go Outdated
Comment thread internal/ui/commit_view.go Outdated
Comment thread internal/ui/commit_view.go
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@coveralls
Copy link
Copy Markdown

coveralls commented May 23, 2026

Coverage Report for CI Build 26342390493

Coverage decreased (-0.5%) to 31.165%

Details

  • Coverage decreased (-0.5%) from the base build.
  • Patch coverage: 20 uncovered changes across 1 file (6 of 26 lines covered, 23.08%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
internal/ui/commit_view.go 26 6 23.08%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1107
Covered Lines: 345
Line Coverage: 31.17%
Coverage Strength: 0.34 hits per line

💛 - Coveralls

rm-hull added 3 commits May 23, 2026 21:03
Added a check to ensure `padding` calculation does not result in a
negative value when the lint error message exceeds the available width,
preventing potential `strings.Repeat` runtime panics.
…mmit-summary into feat/conventional-commits

* 'feat/conventional-commits' of github.com:rm-hull/git-commit-summary:
  Update internal/ui/commit_view.go
Removed the unnecessary `//go:fix` comment from the `uintPtr` helper
function to clean up the codebase.
@rm-hull rm-hull merged commit 96a2a82 into main May 23, 2026
3 checks passed
@rm-hull rm-hull deleted the feat/conventional-commits branch May 23, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

real-time conventional commit linting

2 participants