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

Config file should also read config in ~ en /etc if no config found in current directory #11

Open
ruurd opened this issue Oct 9, 2020 · 4 comments

Comments

@ruurd
Copy link

ruurd commented Oct 9, 2020

Config file should also read config in ~ and /etc if no config found in current directory
As an alternative I would suggest reading the default config from a setting in ~/.gitconfig, for example:

[hound]
    config = /etc/hound/default.yml
@ezekg
Copy link
Owner

ezekg commented Oct 9, 2020

You can provide an alternative path for the config using the -config flag, e.g.:

git hound -config=`realpath ~/.githound.yml` sniff

But I do like the idea of using .gitconfig to configure a default if desired. I'd be open to a PR. 🙂

@ruurd
Copy link
Author

ruurd commented Oct 9, 2020

OK that's crude and invokes a subshell. I was wondering why ~/.githound.yml was not working. I would expect that to be shellexpanded but no - git-hound maintains that the config file is not found.

@ezekg
Copy link
Owner

ezekg commented Oct 9, 2020

@ruurd yeah, the ~ is not currently auto-expanded. Open to a PR to fix that, though.

@ezekg
Copy link
Owner

ezekg commented Oct 9, 2020

Might be a good dep to pull in: https://github.com/mitchellh/go-homedir

Handles a lot of edge cases and platform-dependent issues.

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

No branches or pull requests

2 participants