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

Make it easier to fix "direct dependencies" error message #776

Closed
rintcius opened this issue Apr 15, 2021 · 5 comments
Closed

Make it easier to fix "direct dependencies" error message #776

rintcius opened this issue Apr 15, 2021 · 5 comments

Comments

@rintcius
Copy link

I was thinking that it could be handy if the list of packages that is shown for the following error would instead contain lines that can directly be copy-pasted into spago.dhall (rather than having to edit after paste) or, even better if spago would ask if it's ok to apply the necessary changes to spago.dhall

[error] Some of your project files import modules from packages that are not in the direct dependencies of your project.
To fix this error add the following packages to the list of dependencies in your config:
- package1
- package2
- etc

The following warning may also be incorporated in the suggestion, though this is less work to do manually:

[warn] None of your project files import modules from some projects that are in the direct dependencies of your project.
These dependencies are unused. To fix this warning, remove the following packages from the list of dependencies in your config:
- packageA
- packageB
- etc

A step further and not sure how easy this would be to implement, but it would be awesome if spago could also apply the addition of new dependencies in the same way (as long as it's in the package set). I.e. if it would recognise the package that needs to be added given a certain import that was just added.

@f-f
Copy link
Member

f-f commented Apr 15, 2021

I believe this was fixed in #770?

@rintcius
Copy link
Author

Ah right sorry, looks like it does indeed - I used the latest release but didn't check the unreleased fixes.

Does the last paragraph look feasible?

A step further and not sure how easy this would be to implement, but it would be awesome if spago could also apply the addition of new dependencies in the same way (as long as it's in the package set). I.e. if it would recognise the package that needs to be added given a certain import that was just added.

@f-f
Copy link
Member

f-f commented Apr 15, 2021

@rintcius implementing that would mean having the entire package set sources available at all times (or at least an index of them). We investigated this and other things in #165, and ultimately declared this out of scope for now

@rintcius
Copy link
Author

Thank you @f-f - closing

@f-f
Copy link
Member

f-f commented Apr 15, 2021

You're welcome 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants