Refactor validators into built-in registry chains
This commit is contained in:
@@ -59,7 +59,7 @@ func (v OriginalTextPresenceValidator) Validate(_ context.Context, req Request)
|
||||
|
||||
type NonEmptyCorrectionValidator struct{}
|
||||
|
||||
func (v NonEmptyCorrectionValidator) Name() string { return "non_empty_correction" }
|
||||
func (v NonEmptyCorrectionValidator) Name() string { return "non_empty_corrected_text" }
|
||||
|
||||
func (v NonEmptyCorrectionValidator) Validate(_ context.Context, req Request) (Result, error) {
|
||||
decisions := make([]Decision, 0, len(req.CandidateProposal))
|
||||
@@ -97,7 +97,7 @@ func (v NoEffectValidator) Validate(_ context.Context, req Request) (Result, err
|
||||
|
||||
type ProtectedGlossaryTermValidator struct{}
|
||||
|
||||
func (v ProtectedGlossaryTermValidator) Name() string { return "protected_glossary_terms" }
|
||||
func (v ProtectedGlossaryTermValidator) Name() string { return "protected_terms" }
|
||||
|
||||
func (v ProtectedGlossaryTermValidator) Validate(_ context.Context, req Request) (Result, error) {
|
||||
if req.ModuleKey == "glossary" {
|
||||
@@ -127,7 +127,7 @@ func (v ProtectedGlossaryTermValidator) Validate(_ context.Context, req Request)
|
||||
type GlossaryStageProtectedGlossaryTermValidator struct{}
|
||||
|
||||
func (v GlossaryStageProtectedGlossaryTermValidator) Name() string {
|
||||
return "glossary_stage_protected_glossary_terms"
|
||||
return "protected_terms"
|
||||
}
|
||||
|
||||
func (v GlossaryStageProtectedGlossaryTermValidator) Validate(_ context.Context, req Request) (Result, error) {
|
||||
|
||||
Reference in New Issue
Block a user