mix deps.sync

46 views
Skip to first unread message

Neil Lyons

unread,
Mar 17, 2023, 12:18:45 PM3/17/23
to elixir-lang-core
I removed a dependency from `deps/0` in  `mix.exs` and realised that it didn't remove it from the lock file.

Is `mix deps.clean --unlock --unused` the correct way to fully remove a dependency [0]?

If so I was thinking most developers probably don't realise this. Perhaps a new alias could be added called `deps.sync` that you run after adding/removing dependencies 🤔

eg.

"deps.sync": ["deps.get", "mix deps.clean --unlock --unused"]

Jonathan Arnett

unread,
Mar 18, 2023, 9:13:31 AM3/18/23
to elixir-lang-core
I fully agree that this needs to be more discoverable.  Every year or so, I remove a dependency and then have to go find that TIL article that gives me the right flags.

José Valim

unread,
Mar 18, 2023, 10:26:10 AM3/18/23
to elixir-l...@googlegroups.com
"mix deps.unlock --unused" is generally the way to go about it. You can also add "mix deps.unlock --check-unused" to CI.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/35b1b446-ed20-46d6-ae82-56ea08bb352bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages