Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tm2/pkg/std): add failing regexp in MemPackage.Validate's errors #1673

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tm2/pkg/std/memfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ var (
// NOTE: this is to prevent conflicts with nested paths.
func (mempkg *MemPackage) Validate() error {
if !rePkgName.MatchString(mempkg.Name) {
return errors.New(fmt.Sprintf("invalid package name %q", mempkg.Name))
return errors.New(fmt.Sprintf("invalid package name %q, failed to match %q", mempkg.Name, rePkgName))
}
if !rePkgOrRlmPath.MatchString(mempkg.Path) {
return errors.New(fmt.Sprintf("invalid package/realm path %q", mempkg.Path))
return errors.New(fmt.Sprintf("invalid package/realm path %q, failed to match %q", mempkg.Path, rePkgOrRlmPath))
}
fnames := map[string]struct{}{}
for _, memfile := range mempkg.Files {
if !reFileName.MatchString(memfile.Name) {
return errors.New(fmt.Sprintf("invalid file name %q", memfile.Name))
return errors.New(fmt.Sprintf("invalid file name %q, failed to match %q", memfile.Name, reFileName))
}
if _, exists := fnames[memfile.Name]; exists {
return errors.New(fmt.Sprintf("duplicate file name %q", memfile.Name))
Expand Down
Loading