Skip to content

Conversation

@srishtea-22
Copy link
Contributor

@srishtea-22 srishtea-22 commented Oct 4, 2025

Description

Restructured the project to follow standard Go project layout conventions. This improves code organization, makes the project more idiomatic, and easier for contributors to navigate.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

  • Moved src/ directory to cmd/commit-msg/ following Go conventions
  • Reorganized AI provider packages (chatgpt, claude, gemini, grok) into internal/
  • Moved types/ package to appropriate location
  • Created assets/ directory and moved media files (commit.gif, image.png)
  • Fixed typo: renamed promt.go to prompt.go
  • Updated all import paths throughout the codebase

Testing

  • Tested with Gemini API
  • Tested with Grok API
  • Tested on Windows
  • Tested on Linux
  • Tested on macOS
  • Added/updated tests (if applicable)

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have tested this in a real Git repository
  • I have read the CONTRIBUTING.md guidelines

Additional Notes

  • All import paths have been updated to reflect the new structure
  • The project now follows the standard Go project layout
  • No functional changes were made - only file organization

For Hacktoberfest Participants

  • This PR is submitted as part of Hacktoberfest 2025

Summary by CodeRabbit

  • Refactor
    • Reorganized internal package layout and standardized type references for a cleaner project structure.
    • Updated build targets and documentation (build/run instructions and CI) to reflect the new layout.
    • No user-facing changes to commands, flags, or runtime behavior; existing workflows remain unchanged.
    • Prepares groundwork for future improvements and more reliable builds.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 4, 2025

Walkthrough

Imports were updated to reflect a repository layout change: references to src/... were replaced with internal/... and src/types was moved to pkg/types across multiple packages. No function signatures, exported entities, or runtime control flow were changed.

Changes

Cohort / File(s) Summary of Changes
Types package path update
internal/chatgpt/chatgpt.go, internal/claude/claude.go, internal/gemini/gemini.go, internal/grok/grok.go, internal/git/operations.go, internal/stats/statistics.go, cmd/commit-msg/main.go
Updated imports from .../src/types to .../pkg/types. No logic or API changes.
Internal modules path reorg
cmd/commit-msg/main.go, internal/git/operations.go, internal/stats/statistics.go, internal/...
Updated imports from .../src/internal/... to .../internal/... for packages like display, utils, scrubber, and provider modules (chatgpt/claude/gemini/grok). No functional changes.
Build/workflow & docs
.github/workflows/build-and-release.yml, CONTRIBUTING.md, README.md
Build and run targets updated to ./cmd/commit-msg (instead of ./src); README asset path adjusted. No code logic changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

Suggested labels

hacktoberfest-accepted

Poem

I twitch my whiskers, hop with glee,
Paths reshuffled, tidy as can be.
From src to internal, types to pkg,
Imports aligned — a neat little jig.
A rabbit's wink for the clean-up spree 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and succinctly summarizes the primary change of restructuring the project to follow Go conventions without extraneous detail, making it easy for teammates to understand the scope of the refactor at a glance.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2746de and b9d64dd.

📒 Files selected for processing (3)
  • .github/workflows/build-and-release.yml (1 hunks)
  • CONTRIBUTING.md (1 hunks)
  • README.md (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • CONTRIBUTING.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build Go Binary (windows-latest)
🔇 Additional comments (2)
.github/workflows/build-and-release.yml (1)

81-84: Build step now targets cmd/commit-msg.

Nice job updating the workflow to the new layout—this should clear the failing CI that was still looking under src.

README.md (1)

14-14: Docs aligned with the cmd/commit-msg layout.

Appreciate the doc refresh so the build/run instructions and assets match the reorganized tree.

Also applies to: 105-127


Comment @coderabbitai help to get the list of available commands and usage tips.

@DFanso DFanso self-requested a review October 4, 2025 14:38
Copy link
Owner

@DFanso DFanso left a comment

Choose a reason for hiding this comment

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

hey @srishtea-22 there is a conflict with the claude.go file can u resolve it

@DFanso DFanso added enhancement New feature or request hacktoberfest Eligible for Hacktoberfest labels Oct 4, 2025
@DFanso DFanso linked an issue Oct 4, 2025 that may be closed by this pull request
@srishtea-22
Copy link
Contributor Author

yeah @DFanso, claude.go was probably edited while I moved it to internal/
I'm working on resolving this conflict

@DFanso
Copy link
Owner

DFanso commented Oct 4, 2025

thank you

@DFanso DFanso self-requested a review October 4, 2025 15:29
@DFanso
Copy link
Owner

DFanso commented Oct 4, 2025

hey @srishtea-22 have to update the pipeline also git action is failing stat /home/runner/work/commit-msg/commit-msg/src: directory not found

Copy link
Owner

@DFanso DFanso left a comment

Choose a reason for hiding this comment

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

mentiond above

@DFanso DFanso self-requested a review October 4, 2025 15:50
Copy link
Owner

@DFanso DFanso left a comment

Choose a reason for hiding this comment

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

Supiri 🎊 (meaning Excellent in Sinhala)

@DFanso DFanso merged commit 0b3ae6e into DFanso:main Oct 4, 2025
8 checks passed
@DFanso DFanso added hacktoberfest-accepted Approved Hacktoberfest contribution go Pull requests that update go code labels Oct 4, 2025
@srishtea-22
Copy link
Contributor Author

@DFanso Thanks for catching that, it was a miss on my part. I've now updated the workflow and READMEs.

@srishtea-22 srishtea-22 deleted the refactor/project-structure branch October 4, 2025 16:23
@coderabbitai coderabbitai bot mentioned this pull request Oct 5, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code hacktoberfest Eligible for Hacktoberfest hacktoberfest-accepted Approved Hacktoberfest contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Refactor project structure to follow Go conventions

2 participants