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

Fix behaviour when config loading fails #30

Merged

Conversation

pcgilday
Copy link
Contributor

@pcgilday pcgilday commented Oct 18, 2016

Proposed changes

When loading a config and result is falsy, set empty config for result.

fixes #26

Types of changes

What types of changes does your code introduce
Put an x in the boxes that apply

  • Bug (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature which changes existing functionality)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING guide
  • Lint and unit tests pass with my changes
  • I have added tests that prove my fix is effective/works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes are merged and published in downstream modules

Further comments

Do you have any suggestions on how to add a test for this? cosmiconfig searches the file tree, and there is a config in the file tree, so, I wasn't sure the best approach to write a test that does not have a config? I will think a little longer on it, but wanted to get the PR open and see if anyone had suggestions.

I did not see a CONTRIBUTING.md file or contributing guidelines in this repo, so I did the best I could to follow what I believe would be expected. Let me know if I missed anything.

Reviewers: @michael-ciniawsky, @ertrzyiks

@GitCop
Copy link

GitCop commented Oct 18, 2016

⚠️ Pull Request - Issues ⚠️

  • Commit: 1ebe246
    • Commits must be in the following format: %{type}(%{scope}): %{description}

This message was auto-generated by https://gitcop.com

@pcgilday pcgilday force-pushed the 26-fix-no-config-behaviour branch from 1ebe246 to b549bc6 Compare October 18, 2016 20:49
@coveralls
Copy link

coveralls commented Oct 18, 2016

Coverage Status

Coverage decreased (-0.6%) to 85.714% when pulling b549bc6 on pcgilday:26-fix-no-config-behaviour into 5e7e307 on michael-ciniawsky:master.

@coveralls
Copy link

coveralls commented Oct 18, 2016

Coverage Status

Coverage decreased (-0.6%) to 85.714% when pulling b549bc6 on pcgilday:26-fix-no-config-behaviour into 5e7e307 on michael-ciniawsky:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.6%) to 85.714% when pulling b549bc6 on pcgilday:26-fix-no-config-behaviour into 5e7e307 on michael-ciniawsky:master.

@michael-ciniawsky michael-ciniawsky merged commit 0f53d08 into postcss:master Oct 19, 2016
@michael-ciniawsky
Copy link
Collaborator

👍 Thx

@pcgilday pcgilday deleted the 26-fix-no-config-behaviour branch October 19, 2016 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix behaviour when config loading failes
4 participants