context.config doesn’t work with config root is an array
See original GitHub issueBug Report
A *.yml
file can return an Array, just like JSON. The problem is that we implement the defaulting of configuration using Object.assign()
which doesn’t work with arrays too well, it turns an array into an object
Besides Object.assign does only default on the top level, not deeply. I’d recommend to use _.defaultsDeep
instead.
In my particular case I want to implement configuration as described at https://github.com/wip/app/issues/96#issuecomment-397750538
When .github/wip.yml
looks like this:
- terms:
- hold
locations:
- label
- terms:
- fixup!
- squash!
locations:
- commits
and I load the config like this
const config = await context.config('wip.yml')
Current Behavior
config
is an object with two keys: {1: {...}, 2: {...}}
Expected behavior/code
config
should be an array with two items: [{terms, locations}, {terms, locations}]
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Appending within an array could work if we could reference ...
I am facing a situation that I don't understand. In my config file if I write at the top level: exports += {...
Read more >Add context path to Spring Boot application - Stack Overflow
The reason for the context root is we want the app to be accessed from localhost:port/{app_name} and have all the controller paths append...
Read more >Configuring Jest
The Jest philosophy is to work great by default, but sometimes you just ... To read TypeScript configuration files Jest requires ts-node ....
Read more >Content Configuration - Tailwind CSS
Configuring the content sources for your project. The content section of your tailwind.config.js file is where you configure the paths to all of...
Read more >Configuration Files - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would be solved by #619
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.