feat: go 1.25.5, dependency updates, renamed internal/errors (#129)

* feat: rename internal/errors to internal/apperrors

* fix(tests): clear env values before using in tests

* feat: rename internal/errors to internal/apperrors

* chore(deps): update go and all dependencies

* chore: remove renovate from pre-commit, formatting

* chore: sonarcloud fixes

* feat: consolidate constants to appconstants/constants.go

* chore: sonarcloud fixes

* feat: simplification, deduplication, test utils

* chore: sonarcloud fixes

* chore: sonarcloud fixes

* chore: sonarcloud fixes

* chore: sonarcloud fixes

* chore: clean up

* fix: config discovery, const deduplication

* chore: fixes
This commit is contained in:
2026-01-01 23:17:29 +02:00
committed by GitHub
parent 85a439d804
commit 7f80105ff5
65 changed files with 2321 additions and 1710 deletions

View File

@@ -8,7 +8,8 @@ import (
"github.com/schollz/progressbar/v3"
"github.com/ivuorinen/gh-action-readme/internal/errors"
"github.com/ivuorinen/gh-action-readme/appconstants"
"github.com/ivuorinen/gh-action-readme/internal/apperrors"
)
// MockMessageLogger implements MessageLogger for testing.
@@ -57,13 +58,13 @@ func (m *MockErrorReporter) Error(format string, args ...any) {
m.ErrorCalls = append(m.ErrorCalls, formatMessage(format, args...))
}
func (m *MockErrorReporter) ErrorWithSuggestions(err *errors.ContextualError) {
func (m *MockErrorReporter) ErrorWithSuggestions(err *apperrors.ContextualError) {
if err != nil {
m.ErrorWithSuggestionsCalls = append(m.ErrorWithSuggestionsCalls, err.Error())
}
}
func (m *MockErrorReporter) ErrorWithContext(_ errors.ErrorCode, message string, _ map[string]string) {
func (m *MockErrorReporter) ErrorWithContext(_ appconstants.ErrorCode, message string, _ map[string]string) {
m.ErrorWithContextCalls = append(m.ErrorWithContextCalls, message)
}
@@ -405,16 +406,16 @@ func (m *mockCompleteOutput) Fprintf(w *os.File, format string, args ...any) {
m.logger.Fprintf(w, format, args...)
}
func (m *mockCompleteOutput) Error(format string, args ...any) { m.reporter.Error(format, args...) }
func (m *mockCompleteOutput) ErrorWithSuggestions(err *errors.ContextualError) {
func (m *mockCompleteOutput) ErrorWithSuggestions(err *apperrors.ContextualError) {
m.reporter.ErrorWithSuggestions(err)
}
func (m *mockCompleteOutput) ErrorWithContext(code errors.ErrorCode, message string, context map[string]string) {
func (m *mockCompleteOutput) ErrorWithContext(code appconstants.ErrorCode, message string, context map[string]string) {
m.reporter.ErrorWithContext(code, message, context)
}
func (m *mockCompleteOutput) ErrorWithSimpleFix(message, suggestion string) {
m.reporter.ErrorWithSimpleFix(message, suggestion)
}
func (m *mockCompleteOutput) FormatContextualError(err *errors.ContextualError) string {
func (m *mockCompleteOutput) FormatContextualError(err *apperrors.ContextualError) string {
return m.formatter.FormatContextualError(err)
}
func (m *mockCompleteOutput) Progress(format string, args ...any) {
@@ -444,7 +445,7 @@ type MockErrorFormatter struct {
FormatContextualErrorCalls []string
}
func (m *MockErrorFormatter) FormatContextualError(err *errors.ContextualError) string {
func (m *MockErrorFormatter) FormatContextualError(err *apperrors.ContextualError) string {
if err != nil {
formatted := err.Error()
m.FormatContextualErrorCalls = append(m.FormatContextualErrorCalls, formatted)
@@ -462,15 +463,15 @@ type mockErrorManager struct {
}
func (m *mockErrorManager) Error(format string, args ...any) { m.reporter.Error(format, args...) }
func (m *mockErrorManager) ErrorWithSuggestions(err *errors.ContextualError) {
func (m *mockErrorManager) ErrorWithSuggestions(err *apperrors.ContextualError) {
m.reporter.ErrorWithSuggestions(err)
}
func (m *mockErrorManager) ErrorWithContext(code errors.ErrorCode, message string, context map[string]string) {
func (m *mockErrorManager) ErrorWithContext(code appconstants.ErrorCode, message string, context map[string]string) {
m.reporter.ErrorWithContext(code, message, context)
}
func (m *mockErrorManager) ErrorWithSimpleFix(message, suggestion string) {
m.reporter.ErrorWithSimpleFix(message, suggestion)
}
func (m *mockErrorManager) FormatContextualError(err *errors.ContextualError) string {
func (m *mockErrorManager) FormatContextualError(err *apperrors.ContextualError) string {
return m.formatter.FormatContextualError(err)
}