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
This closes #19
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).
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 👍🏻
Context
This PR adds support for a separate config file that could be used instead of
Package.swift
to configure thekomondor
git hooks. The separate config file is a viable choice when you wannakomondor
with something like Mint or other similar tools.By default,
komondor
is going to usePackage.swift
to configure hooks and when--use-config-file
flag is being usedkomondor
gonna try to usekomondor.yml
file from the project root folder.--use-config-file
flag is supported byinstall
andrun
commands.Examples
With install command
With run command
Additional Notes
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
orKomondorFramework
) and shall be probably done in a separate PR (I will be glad to do that in a follow-up PR).