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

Add config dotfile and global dotfile #380

Open
boyter opened this issue Mar 6, 2023 · 4 comments
Open

Add config dotfile and global dotfile #380

boyter opened this issue Mar 6, 2023 · 4 comments

Comments

@boyter
Copy link
Owner

boyter commented Mar 6, 2023

Needs to be there to allow setting up how scc should count things without needing to invoke arcane commands.

Possibly allow a global one as well? Something to consider. It should not need to be supplied, but instead just picked up by scc from where it runs to allow excluding of say vendor for some Go projects and such.

@spenserblack
Copy link
Contributor

Possibly allow a global one as well?

I think a setting to support a feature like #346 would definitely need to be global. In fact, something like #346 should not be configured at the project level, since that would be too biased for most projects.

@boyter boyter changed the title Add config file Add config dotfile and global dotfile Oct 2, 2024
@boyter boyter moved this to TODO in Scc Release 3.5.0 Oct 2, 2024
@boyter
Copy link
Owner Author

boyter commented Oct 3, 2024

https://github.com/joho/godotenv use this rather than implement my own version seems sensible.

@spenserblack Yep. I would want both global and project support for this.

TODO is investigate how do actually get this working well, as dotfiles should always be overriden by command line params where supplied.

@spenserblack
Copy link
Contributor

spenserblack commented Oct 3, 2024

dotfiles should always be overriden by command line params where supplied.

One interesting thing I've seen in the Ruby ecosystem are "opts lists", that look like this:

--option foo
--flag

Basically, it's a space- and newline-separated list of arguments to pass to the argument parser. It's pretty simple and clever because the user doesn't have to learn the config file's format -- as long as they know the CLI, they basically know all they need.


Another thing: in the Rust ecosystem there's a package that wraps CLI, environment variables, and config all in one. Usage is vaguely like this (basically psuedocode)

let config = Config::new().filename("config.json");
let values = config.parse();

TBH I think such a package should exist in every language. I'd be interested in helping out to build such a package if there isn't already a candidate.

@boyter
Copy link
Owner Author

boyter commented Oct 8, 2024

#475 should be resolved by this

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

No branches or pull requests

2 participants