Validate internal decisions and reconcile exact model references
This commit is contained in:
@@ -2,6 +2,7 @@ package glossary
|
||||
|
||||
import (
|
||||
"context"
|
||||
frameworkvalidators "gitea.maximumdirect.net/eric/audita/v3/internal/framework/validators"
|
||||
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/proposal_generation"
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
type Module struct {
|
||||
validators []contracts.Validator
|
||||
validators []frameworkvalidators.Validator
|
||||
}
|
||||
|
||||
func New() (*Module, error) {
|
||||
@@ -33,8 +34,8 @@ func (m *Module) ReplacementPolicy() proposals.ReplacementPolicy {
|
||||
return proposals.ReplacementPolicyReplaceAll
|
||||
}
|
||||
|
||||
func (m *Module) Validators() []contracts.Validator {
|
||||
return append([]contracts.Validator(nil), m.validators...)
|
||||
func (m *Module) Validators() []frameworkvalidators.Validator {
|
||||
return append([]frameworkvalidators.Validator(nil), m.validators...)
|
||||
}
|
||||
|
||||
func (m *Module) Propose(ctx context.Context, req contracts.ProposalRequest) (contracts.ProposalResult, error) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package grammar
|
||||
|
||||
import (
|
||||
"context"
|
||||
frameworkvalidators "gitea.maximumdirect.net/eric/audita/v3/internal/framework/validators"
|
||||
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/proposal_generation"
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
type Module struct {
|
||||
validators []contracts.Validator
|
||||
validators []frameworkvalidators.Validator
|
||||
}
|
||||
|
||||
func New() (*Module, error) {
|
||||
@@ -33,8 +34,8 @@ func (m *Module) ReplacementPolicy() proposals.ReplacementPolicy {
|
||||
return proposals.ReplacementPolicyRequireUnique
|
||||
}
|
||||
|
||||
func (m *Module) Validators() []contracts.Validator {
|
||||
return append([]contracts.Validator(nil), m.validators...)
|
||||
func (m *Module) Validators() []frameworkvalidators.Validator {
|
||||
return append([]frameworkvalidators.Validator(nil), m.validators...)
|
||||
}
|
||||
|
||||
func (m *Module) Propose(ctx context.Context, req contracts.ProposalRequest) (contracts.ProposalResult, error) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package homophones
|
||||
|
||||
import (
|
||||
"context"
|
||||
frameworkvalidators "gitea.maximumdirect.net/eric/audita/v3/internal/framework/validators"
|
||||
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/proposal_generation"
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
type Module struct {
|
||||
validators []contracts.Validator
|
||||
validators []frameworkvalidators.Validator
|
||||
}
|
||||
|
||||
func New() (*Module, error) {
|
||||
@@ -33,8 +34,8 @@ func (m *Module) ReplacementPolicy() proposals.ReplacementPolicy {
|
||||
return proposals.ReplacementPolicyRequireUnique
|
||||
}
|
||||
|
||||
func (m *Module) Validators() []contracts.Validator {
|
||||
return append([]contracts.Validator(nil), m.validators...)
|
||||
func (m *Module) Validators() []frameworkvalidators.Validator {
|
||||
return append([]frameworkvalidators.Validator(nil), m.validators...)
|
||||
}
|
||||
|
||||
func (m *Module) Propose(ctx context.Context, req contracts.ProposalRequest) (contracts.ProposalResult, error) {
|
||||
|
||||
@@ -154,7 +154,7 @@ func TestHomophonesProtectedGlossaryTermBehaviorRejectsUnsafeCorrection(t *testi
|
||||
if err != nil {
|
||||
t.Fatalf("New error: %v", err)
|
||||
}
|
||||
var protectedValidator contracts.Validator
|
||||
var protectedValidator validators.Validator
|
||||
for _, v := range module.Validators() {
|
||||
if v.Name() == "protected_terms" {
|
||||
protectedValidator = v
|
||||
|
||||
@@ -2,6 +2,7 @@ package spoken_word
|
||||
|
||||
import (
|
||||
"context"
|
||||
frameworkvalidators "gitea.maximumdirect.net/eric/audita/v3/internal/framework/validators"
|
||||
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/proposal_generation"
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
type Module struct {
|
||||
validators []contracts.Validator
|
||||
validators []frameworkvalidators.Validator
|
||||
}
|
||||
|
||||
func New() (*Module, error) {
|
||||
@@ -33,8 +34,8 @@ func (m *Module) ReplacementPolicy() proposals.ReplacementPolicy {
|
||||
return proposals.ReplacementPolicyRequireUnique
|
||||
}
|
||||
|
||||
func (m *Module) Validators() []contracts.Validator {
|
||||
return append([]contracts.Validator(nil), m.validators...)
|
||||
func (m *Module) Validators() []frameworkvalidators.Validator {
|
||||
return append([]frameworkvalidators.Validator(nil), m.validators...)
|
||||
}
|
||||
|
||||
func (m *Module) Propose(ctx context.Context, req contracts.ProposalRequest) (contracts.ProposalResult, error) {
|
||||
|
||||
@@ -154,7 +154,7 @@ func TestSpokenWordProtectedGlossaryTermBehaviorRejectsUnsafeCorrection(t *testi
|
||||
if err != nil {
|
||||
t.Fatalf("New error: %v", err)
|
||||
}
|
||||
var protectedValidator contracts.Validator
|
||||
var protectedValidator validators.Validator
|
||||
for _, v := range module.Validators() {
|
||||
if v.Name() == "protected_terms" {
|
||||
protectedValidator = v
|
||||
|
||||
Reference in New Issue
Block a user