phly / keep-a-changelog

Tools for manipulating CHANGELOG.md files in Keep A Changelog format, including tagging and releasing.
https://phly.github.io/keep-a-changelog/
BSD 2-Clause "Simplified" License
182 stars 23 forks source link

Feature local config #27

Closed Lansoweb closed 6 years ago

Lansoweb commented 6 years ago

Provide a narrative description of what you are trying to accomplish:

The config command provides a config file per project. So you can have a global github token and a gitlab one for a project.

weierophinney commented 6 years ago

@Lansoweb I took the liberty of finishing this up for you, as I merged #24 earlier today. In particular:

Thanks a ton for this!

Lansoweb commented 6 years ago

@Lansoweb I took the liberty of finishing this up for you, as I merged #24 earlier today. In particular:

  • I added tests for the Config and ConfigCommand classes.
  • I renamed Provider\GetProviderTrait to GetConfigValuesTrait, updated it to use the ConfigFileTrait, and added the methods prepareConfig() and getToken(). I updated getProvider() to also accept a Config instance, which is queried for the provider. Essentially, you call prepareConfig() to get a Config instance, and then pull the token and provider from that; the method grabs the configuration, and then overrides it with values passed via options if present.
  • I updated the ReleaseCommand and EntryCommand to use the methods introduced above for the purpose of getting tokens and/or providers.
  • I ensured all tests pass.
  • I did a few other minor refactors for readability and maintainability.

Thanks a ton for this!

Thanks a lot for this tool :)