-
Notifications
You must be signed in to change notification settings - Fork 353
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
Fix lint W59 with a local path that is not an archive #6219
base: master
Are you sure you want to change the base?
Conversation
### <add-url.sh> | ||
basedir=$(echo $BASEDIR | sed "s/\\\\\\\\/\\\\\\\\\\\\\\\\/g") | ||
cat << EOF >> lint.opam | ||
url { src:"file://$basedir/an-archive" } |
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.
I'm not sure to understand the issue. The an-archive
directory doesn't exists at this point right? Shouldn't we raise a warning here for this?
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.
No, linting should only check the content of the file and what is required in an opam file. If we want to check things on disk, it should be another option, as for --check-upstream
let url_archive = | ||
let open OpamStd.Option.Op in | ||
t.url >>| OpamFile.URL.url >>| (fun u -> | ||
OpamSystem.is_archive u.OpamUrl.path) |
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.
i don't think that's right. is_archive
will look up the file locally. If you have an url like https:///etc/fstab
, the path will be looked up.
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.
Good point, we should then add a function that checks if a path looks like an archive, like looks_like_ssh_path
.
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.
i'm not sure we need a new function. Something like that would work just fine i think:
OpamSystem.is_archive u.OpamUrl.path) | |
OpamSystem.local_file u <> None) |
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 don't want to check file existence on disk (which does OpamUrl.local_file
). We want to know if given string seems like an archive path.
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.
What about adding a function similar to OpamUrl.kind
from #5979?
fix #6218