Skip to content
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

cleaning up to follow best practices #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

euforic
Copy link
Owner

@euforic euforic commented Nov 19, 2024

No description provided.

@euforic euforic marked this pull request as draft November 19, 2024 01:47
@euforic euforic marked this pull request as ready for review December 24, 2024 21:34
@euforic euforic requested a review from Copilot December 24, 2024 21:34
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 13 changed files in this pull request and generated 1 comment.

Files not reviewed (7)
  • go.work.sum: Language not supported
  • walk_test.go: Evaluated as low risk
  • import_func_test.go: Evaluated as low risk
  • embed_func_test.go: Evaluated as low risk
  • docs/main.go: Evaluated as low risk
  • templit.go: Evaluated as low risk
  • funcs.go: Evaluated as low risk
Comments suppressed due to low confidence (3)

cmd/templit/templit.go:1

  • Verify if the //nolint comments are necessary. If not, they should be removed.
//nolint:gochecknoglobals,gochecknoinits

dep.go:25

  • [nitpick] The error message invalid path is too generic. Consider providing more context, such as invalid path format in embed URL.
var ErrInvalidPath = errors.New("invalid path")

import_func.go:58

  • The error message is redundant. It should be simplified to avoid redundancy.
return "", fmt.Errorf("file does not exist %s, %w", sourcePath, os.ErrNotExist)

@euforic euforic requested a review from Copilot December 24, 2024 21:37

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 13 changed files in this pull request and generated no comments.

Files not reviewed (7)
  • go.work.sum: Language not supported
  • walk_test.go: Evaluated as low risk
  • import_func_test.go: Evaluated as low risk
  • docs/main.go: Evaluated as low risk
  • embed_func_test.go: Evaluated as low risk
  • templit.go: Evaluated as low risk
  • funcs.go: Evaluated as low risk
Comments suppressed due to low confidence (4)

string_funcs.go:116

  • The function capitalizeFirstLetter may cause an out-of-bounds error if the input string is a single character. Consider updating the function to handle single-character strings properly.
return strings.ToUpper(string(s[0])) + strings.ToLower(s[1:])

dep.go:39

  • The error message 'invalid path' is less descriptive compared to the original 'invalid path format in embed URL'. It should be reverted to the original message for clarity.
expectedError: fmt.Errorf("invalid path"),

import_func.go:57

  • The os.IsNotExist(err) check is inside the condition where err == nil, which means it will never be executed. It should be outside the err == nil condition.
if os.IsNotExist(err) {

import_func.go:65

  • The variable name 'string' is a reserved keyword in Go and should be renamed to avoid confusion. Consider renaming it to 'output'.
string, err := e.Render(sourcePath, data)
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