bloop icon indicating copy to clipboard operation
bloop copied to clipboard

Consider using `dirs-dev` instead of putting everything in `$HOME/.bloop`

Open ckipp01 opened this issue 3 years ago • 5 comments

Lately I've been trying to clean up my $HOME dir and have been noticing that a lot of the Scala ecosystem stick stuff in $HOME. Looking around in Bloop I see that defaultBloopDirectory is $HOME/.bloop.

https://github.com/scalacenter/bloop/blob/efc8d628130fc96ec3875cda1a490dede24fe0d6/bloopgun/src/main/scala/bloop/bloopgun/util/Environment.scala#L26

There are probably other places this is set as well, but I wonder if instead it'd be better to rely on something like dirs-dev to handle this more correctly and place these things in the appropriate places instead of polluting the users home directory. I know this might break some stuff so we could also use $HOME/.bloop for a while as a fallback, but default to the correct places via dirs-dev.

Do you think this would be possible, or do you see any issues with this?

ckipp01 avatar Nov 02 '22 09:11 ckipp01

I think that makes sense, I doubt there is any real reason why it necessarily is done via .bloop in home directory.

Though the only problem is .bloop/bloop.json which would be harder to find when using dirs-dev

tgodzik avatar Nov 02 '22 09:11 tgodzik

Though the only problem is .bloop/bloop.json which would be harder to find when using dirs-dev

I think it shouldn't be a problem right? Since it's a config file I'd just expect it to look for XDG_CONFIG_HOME/bloop/bloop.json (in Linux anyways).

ckipp01 avatar Nov 02 '22 11:11 ckipp01

Maybe not, yeah. So probably not blockers to do that.

tgodzik avatar Nov 02 '22 11:11 tgodzik

Funny enough, I just realized that Bloop actually has everything that is needed to start just utilizing this, but it's not used by everything. You can see this in

https://github.com/scalacenter/bloop/blob/931ce1b480dc0310c56a8783aa99c4c7bf9b3109/shared/src/main/scala/bloop/io/Paths.scala#L25-L31

So for the config stuff mentioned above we literally need to just start using it.

ckipp01 avatar Dec 18 '22 15:12 ckipp01

That's pretty typical in the repo, loads of things were done by one person only team, so it's expected that some stuff might be leftover :sweat:

tgodzik avatar Dec 19 '22 14:12 tgodzik