mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-02-09 00:47:23 +00:00
chore: even more linting, test fixes (#24)
* chore(lint): funcorder * chore(lint): yamlfmt, ignored broken test yaml files * chore(tests): tests do not output garbage, add coverage * chore(lint): fix editorconfig violations * chore(lint): move from eclint to editorconfig-checker * chore(lint): add pre-commit, run and fix * chore(ci): we use renovate to manage updates
This commit is contained in:
@@ -109,6 +109,33 @@ func (v *ConfigValidator) ValidateField(fieldName, value string) *ValidationResu
|
||||
return result
|
||||
}
|
||||
|
||||
// DisplayValidationResult displays validation results to the user.
|
||||
func (v *ConfigValidator) DisplayValidationResult(result *ValidationResult) {
|
||||
if result.Valid {
|
||||
v.output.Success("✅ Configuration is valid")
|
||||
} else {
|
||||
v.output.Error("❌ Configuration has errors")
|
||||
}
|
||||
|
||||
// Display errors
|
||||
for _, err := range result.Errors {
|
||||
v.output.Error(" • %s: %s (value: %s)", err.Field, err.Message, err.Value)
|
||||
}
|
||||
|
||||
// Display warnings
|
||||
for _, warning := range result.Warnings {
|
||||
v.output.Warning(" ⚠️ %s: %s", warning.Field, warning.Message)
|
||||
}
|
||||
|
||||
// Display suggestions
|
||||
if len(result.Suggestions) > 0 {
|
||||
v.output.Info("\nSuggestions:")
|
||||
for _, suggestion := range result.Suggestions {
|
||||
v.output.Printf(" 💡 %s", suggestion)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// validateOrganization validates the organization field.
|
||||
func (v *ConfigValidator) validateOrganization(org string, result *ValidationResult) {
|
||||
if org == "" {
|
||||
@@ -478,30 +505,3 @@ func (v *ConfigValidator) isValidVariableName(name string) bool {
|
||||
|
||||
return matched
|
||||
}
|
||||
|
||||
// DisplayValidationResult displays validation results to the user.
|
||||
func (v *ConfigValidator) DisplayValidationResult(result *ValidationResult) {
|
||||
if result.Valid {
|
||||
v.output.Success("✅ Configuration is valid")
|
||||
} else {
|
||||
v.output.Error("❌ Configuration has errors")
|
||||
}
|
||||
|
||||
// Display errors
|
||||
for _, err := range result.Errors {
|
||||
v.output.Error(" • %s: %s (value: %s)", err.Field, err.Message, err.Value)
|
||||
}
|
||||
|
||||
// Display warnings
|
||||
for _, warning := range result.Warnings {
|
||||
v.output.Warning(" ⚠️ %s: %s", warning.Field, warning.Message)
|
||||
}
|
||||
|
||||
// Display suggestions
|
||||
if len(result.Suggestions) > 0 {
|
||||
v.output.Info("\nSuggestions:")
|
||||
for _, suggestion := range result.Suggestions {
|
||||
v.output.Printf(" 💡 %s", suggestion)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user