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

Directory-level configuration #56

Open
staxmanade opened this issue Feb 27, 2017 · 3 comments
Open

Directory-level configuration #56

staxmanade opened this issue Feb 27, 2017 · 3 comments

Comments

@staxmanade
Copy link
Member

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.

@cmstead
Copy link

cmstead commented Mar 10, 2017

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. : )

@staxmanade
Copy link
Member Author

staxmanade commented Mar 10, 2017

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....

@cmstead
Copy link

cmstead commented Mar 10, 2017

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.

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