-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(dart): add graph support #5374
feat(dart): add graph support #5374
Conversation
} | ||
|
||
deps := make(map[string][]string) | ||
if err := filepath.WalkDir(dir, func(p string, d fs.DirEntry, err error) error { |
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.
Can't we use fsutils.WalkDir?
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.
This is same case as with go.mod
licenses -
err := filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { |
Some example:
User uses default cache path (~/.pub_cache
).
But he scans project dir (e.g. ~/project1
).
In this case we don't add pubspec.yaml
files from ~/.pub_cache
in FS for PostAnalyze.
=> we can't read these files from input.FS
.
Correct me, if i missed something.
Perhaps we can use os.DirFS("/")
(fsutils.WalkDir(os.DirFS("/"), ".", required, func(path string, d fs.DirEntry, r io.Reader) error
). But i am not sure that it make sense.
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.
Doesn't os.DirFS(dir)
work?
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.
After my suggestion about os.DirFS
I didn't think of an obvious solution 😄 .
Thank you!
I used fsutils.WalkDir
in 3abdc47
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Description
Cache dir contains
pubspec.yaml
for each dependency.We can parse these files and use them to build dependency graph.
example of work:
TODO for another PR:
Package.Dev
flag (to exclude dev deps)LICENSE
files (we can checkLICENSE
file next topubspec.yaml
and find licenses):
separator for ID - https://dart.dev/tools/pub/cmd/pub-add#version-constraintRelated issues
Checklist