Directory-level configuration
We have a number of ways to specify configuration which drives approvals behavior.
One ideal piece of configuration I would like to get to would be project-level (err directory level) config files.
Say you have a test project that looks like this.
├───src
│ main.js
│
└───tests
├───folder1
│ test1.js
│
└───folder2
test2.js
Also say the approval tests in folder require different "configuration" than the rest of the project?
You can do this by passing a common configuration object at the verify method level like (.verify(__dirname, "test-file-name", "the thing to verify", {...config here...}); but I would like to at minimum see a project-level configuration where we can look up the folder-tree from the test for a .approvalsConfig file in hopes to allow for more configuration-over-explicit-coding (is that a term?).
Anyway, what if you could drop .approvalsConfig in the project like such:
│ .approvalsConfig <--- project root config
│
├───src
│ main.js
│
└───tests
├───folder1
│ .approvalsConfig <--- folder specific config overrides root project config
│ test1.js
│
└───folder2
test2.js
This could allow for an overall project-level set of configuration, as well as the ability to override some configuration properties at a specific folder level.
Out of curiosity, would it be reasonable to start off with just a project root approvalsConfig? I know this doesn't resolve the entire enhancement, but it might be a reasonable starting point. Side note, I am willing (time dependent) to dig in and see if I can come up with a reasonable first pass at something like a project root config as a proof of concept.
Let me know your thoughts, please. : )
I like the idea of a project-root config... The question is how to determine the project root? So if we can work through that, let's do it....
I know there is logic implemented for editorconfig to do that kind of thing, so I'll probably dig in there to start. You can grab the cwd from process as well, so that will likely play a role. I'll share findings here, as I go.