lspitzner / brittany

haskell source code formatter
GNU Affero General Public License v3.0
690 stars 72 forks source link

Allow brittany to run when it can't write a global config file #226

Open ghorn opened 5 years ago

ghorn commented 5 years ago

My use case is running brittany in a sandbox, providing it exactly one .brittany.yaml config file, and not letting brittany do anything except write to stdout. There are no environment variables in this sandbox.

I have two problems. One is that brittany calls Directory.getAppUserDataDirectory (via readConfigsWithUserConfig and userConfigPath) which throws an exception when the environment variable HOME is not defined.

The second is that if I define the env var HOME then brittany tries to write a config file there, but it has no write permissions in this sandbox.

Is it possible to run brittany in a "pure" mode where it doesn't write a global config file?

blackgnezdo commented 2 years ago

I would also love to have the option for brittany to not touch $HOME. Sadly, setting --config-file flag does not seem to prevent $HOME access.