Add duplicate detection for compose record values

For now only case-sensitive detection is supported, there are 2 type of duplicate detection, one is strict mode which will throw an error on record save if there is any duplicate record with matching value and non-strict mode will only show a warning and won't prevent record saving.
This commit is contained in:
Vivek Patel
2022-09-21 19:24:43 +05:30
parent b3cdbd060f
commit 9d46f5c234
18 changed files with 471 additions and 103 deletions
+5 -3
View File
@@ -43,9 +43,10 @@ func Proc() {
// workaround because
// filepath.Join merges "*","*" into "**" instead of "*/*"
typeSrcPath = filepath.Join("*"+string(filepath.Separator)+"*", "types.yaml")
typeSrc []string
typeDefs []*typesDef
pkgTypeSrcPath = filepath.Join("*"+string(filepath.Separator)+"*"+string(filepath.Separator)+"*", "types.yaml")
typeSrcPath = filepath.Join("*"+string(filepath.Separator)+"*", "types.yaml")
typeSrc []string
typeDefs []*typesDef
// workaround because
// filepath.Join merges "*","*" into "**" instead of "*/*"
@@ -144,6 +145,7 @@ func Proc() {
output("loaded %d event definitions from %s\n", len(eventSrc), eventSrcPath)
typeSrc = glob(typeSrcPath)
typeSrc = append(typeSrc, glob(pkgTypeSrcPath)...)
output("loaded %d type definitions from %s\n", len(typeSrc), typeSrcPath)
exprTypeSrc = glob(exprTypeSrcPath)