-
Notifications
You must be signed in to change notification settings - Fork 275
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
Add more tests for buf.work.yaml and normalize and validate DirPaths #2613
Conversation
if err := validateDirPathsNoOverlap(slicesextended.MapToSortedSlice(dirPathMap)); err != nil { | ||
return err | ||
// TODO: use this line: | ||
// sortedNormalDirPaths := slicesextended.MapKeysToSortedSlice(normalDirPathToDirPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll also want to update the documentation for DirPaths
to state that paths are normalized and validated when constructing a BufWorkYAMLFile
, and that DirPaths
returns only normalized and validated paths.
@@ -129,13 +129,13 @@ type bufWorkYAMLFile struct { | |||
} | |||
|
|||
func newBufWorkYAMLFile(fileVersion FileVersion, dirPaths []string) (*bufWorkYAMLFile, error) { | |||
if err := validateBufWorkYAMLDirPaths(dirPaths); err != nil { | |||
sortedNormalDirPaths, err := validateBufWorkYAMLDirPaths(dirPaths) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've used normalized
throughout rest of codebase, not normal
, update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in f2481c7
fixed in 4ee426d |
This PR adds tests for
buf_work_yaml_file.go
.This PR also fixes a bug where
newBufWorkYAMLFile
does not setdirPaths
as the normalized input paths (but setdirPaths
as the input paths as-is).