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

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

Open
ckipp01 opened this issue Nov 2, 2022 · 5 comments
Open
Labels
difficulty / easy Any change that is easy to implement. good first issue

Comments

@ckipp01
Copy link
Member

ckipp01 commented Nov 2, 2022

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.

def defaultBloopDirectory: Path = homeDirectory.resolve(".bloop")

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?

@tgodzik
Copy link
Contributor

tgodzik commented Nov 2, 2022

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

@ckipp01
Copy link
Member Author

ckipp01 commented Nov 2, 2022

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).

@tgodzik
Copy link
Contributor

tgodzik commented Nov 2, 2022

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

@ckipp01
Copy link
Member Author

ckipp01 commented Dec 18, 2022

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

private def createDirFor(filepath: String): AbsolutePath =
AbsolutePath(Files.createDirectories(NioPaths.get(filepath)))
final val bloopCacheDir: AbsolutePath = createDirFor(projectDirectories.cacheDir)
final val bloopDataDir: AbsolutePath = createDirFor(projectDirectories.dataDir)
final val bloopLogsDir: AbsolutePath = createDirFor(bloopDataDir.resolve("logs").syntax)
final val bloopConfigDir: AbsolutePath = createDirFor(projectDirectories.configDir)

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

@tgodzik
Copy link
Contributor

tgodzik commented Dec 19, 2022

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 😓

@ckipp01 ckipp01 added good first issue difficulty / easy Any change that is easy to implement. labels Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty / easy Any change that is easy to implement. good first issue
Projects
None yet
Development

No branches or pull requests

2 participants