dominictarr / rc

The non-configurable configuration loader for lazy people.
Other
1.02k stars 97 forks source link

Idea: read "root" option to stop reading in parent dir for other config #63

Closed MoOx closed 9 years ago

MoOx commented 9 years ago

Some tools like eslint or editorconfig support this kind of option, would you be open to support that via a new argument (a third argument that can be a string ("root", "stop", whatever) or a bool (for "root": true)?

dominictarr commented 9 years ago

hmmm, this doesn't really vibe with my intuitions... if that is really a problem, it's probably that your setup is too complex. If you really think this is a good idea, can you provide a detailed description about what problem this would solve, and when you would use it.

MoOx commented 9 years ago

The idea is simple http://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy (see root explanation). It's not overkill or complex. Just a simple option to stop looking up in the fs tree.

dominictarr commented 9 years ago

Wow, eslint has a whole inheritence system for configuration! You didn't answer my question,

If you really think this is a good idea, can you provide a detailed description about what problem this would solve, and when you would use it?

MoOx commented 9 years ago

Just stop accessing the fs when a user wants his configuration to be as defined in at a specific level without trying to get (+merge) all other configuration files in parent directory. Like "hey, I know this config is engough, not need to lookup for other config to merge". But maybe I should just no use this module and create another one to load one file only.

dominictarr commented 9 years ago

@MoOx "because the user wants to" is not an answer, why does the user want to? why is touching another file a problem? what is the user trying to do that can't be done with rc as it is?