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

Support for a separate configuration file #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ivanlisovyi
Copy link

@ivanlisovyi ivanlisovyi commented Nov 21, 2021

Context

This PR adds support for a separate config file that could be used instead of Package.swift to configure the komondor git hooks. The separate config file is a viable choice when you wanna komondor with something like Mint or other similar tools.

By default, komondor is going to use Package.swift to configure hooks and when --use-config-file flag is being used komondor gonna try to use komondor.yml file from the project root folder.

--use-config-file flag is supported by install and run commands.

Examples

With install command

swift run -c release komondor install --use-config-file

With run command

swift run -c release komondor run pre-commit --use-config-file

Additional Notes

  1. This closes Use real configuration file instead of Package.swift code #19
  2. This PR doesn't contain any unit tests because with the current package setup it's really hard to have any. I think to support the unit tests properly the majority of komondor source code needs to be moved to a separate target. I think this kind of change is a little bit out of the scope of this PR. It shall be relatively straightforward to extract the source code into a separate target (e.g. KomondorCore or KomondorFramework) and shall be probably done in a separate PR (I will be glad to do that in a follow-up PR).

@orta
Copy link
Member

orta commented Mar 3, 2022

Oops, I missed this - sorry.

I'm open to the idea, but I'd rather not gain another dependency to pay for it - if the config was JSON 👍🏻. WRT adding tests, I'm open to those changes too 👍🏻

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.

Use real configuration file instead of Package.swift code
2 participants