8000 feat(init): add main package and command execution by jsburckhardt · Pull Request #5 · jsburckhardt/gic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(init): add main package and command execution #5

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

Merged
merged 5 commits into from
Aug 29, 2024

Conversation

jsburckhardt
Copy link
Owner
  • Introduce main package and cmd package for command execution in gic.
  • Rename cmd/gic/main.go to cmd/root.go for a clearer command structure.
  • Add command execution logic and persistent flags.

chore(devcontainer): update devcontainer settings

  • Update .devcontainer/devcontainer.json with Golang tooling settings and editor preferences.
  • Minor cleanup and commenting out unnecessary lines.

chore(gitignore): update gitignore rules

  • Add gic to .gitignore to prevent tracking of the binary.

ci(linter): enable revive linter

  • Update .golangci.yml to include revive linter.

refactor(modules): update go module references

  • Change module reference from github.com/jsburckhardt/gic to gic.
  • Adjust dependencies in go.mod accordingly.

docs(goreleaser): comment out go generate step

  • Comment out the go generate step in .goreleaser.yaml.

test(git): update import paths in git tests

  • Adjust import paths in internal/git/git_test.go to match the updated module structure.

- Introduce main package and cmd package for command execution in gic.
- Rename `cmd/gic/main.go` to `cmd/root.go` for a clearer command structure.
- Add command execution logic and persistent flags.

chore(devcontainer): update devcontainer settings

- Update `.devcontainer/devcontainer.json` with Golang tooling settings and editor preferences.
- Minor cleanup and commenting out unnecessary lines.

chore(gitignore): update gitignore rules

- Add `gic` to `.gitignore` to prevent tracking of the binary.

ci(linter): enable revive linter

- Update `.golangci.yml` to include `revive` linter.

refactor(modules): update go module references

- Change module reference from `github.com/jsburckhardt/gic` to `gic`.
- Adjust dependencies in `go.mod` accordingly.

docs(goreleaser): comment out go generate step

- Comment out the `go generate` step in `.goreleaser.yaml`.

test(git): update import paths in git tests

- Adjust import paths in `internal/git/git_test.go` to match the updated module structure.
- Added package-level documentation to clarify the purpose and functionality of the `cli`, `config`, `git`, and `llm` packages.
- Documented functions in the `cli`, `config`, `git`, and `llm` packages for better code understanding and maintainability.
- Corrected capitalization in `config.Config` struct and relevant functions.

Add new `fmt` target to Makefile for code formatting.
- Added package-level documentation for `cmd` package.
- Documented `Execute` function in `cmd/root.go`.
- Added documentation for functions `GenerateCommitMessageAzure`, `GenerateCommitMessageAzureAD`, and `GenerateCommitMessageOpenAI` in `llm.go`.

No functionality changes, purely documentation updates.
The CI workflow `ci.yaml` now specifies that the test job requires the lint job to complete first.

refactor(config): improve code readability and maintainability

- Introduced constants for emptyString, zeroTokens, and defaultTokens.
- Adjusted functions to use these constants where applicable.
- Validation functions now have improved logging.

refactor(root): simplify command execution and error handling

- Introduced a new constant for exitCodeFailure.
- Refactored the root command to remove unnecessary variable declarations and use more concise logic.
- Updated error handling to use log.Fatal for more consistent behavior.

refactor(cli): handle errors in LoadEnv function

The `LoadEnv` function now returns an error instead of causing a fatal log.

fix(linter): update colored output format

Changed the output format of the linter to use `colored-tab` instead of `colored-line-number`.

feat(linter): enforce maximum line length of 120 characters

Added a new rule to the `revive` linter settings to enforce a maximum line length of 120 characters.

fix(llm): handle empty git diff in commit message generation

The `GenerateCommitMessage` function now correctly handles cases where there are no staged changes.
Refactor the root command's execution to handle errors gracefully instead of using log.Fatal.
Update the function signature to return an error for better error propagation.
Additionally, simplify file paths in launch configuration.

Related to error handling improvements and general code cleanliness.
@jsburckhardt jsburckhardt merged commit 2b10d9d into main Aug 29, 2024
3 checks passed
@jsburckhardt jsburckhardt deleted the fix/update-ci branch September 2, 2024 12:41
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.

1 participant
0