raviqqe / muffet

Fast website link checker in Go
MIT License
2.46k stars 95 forks source link

Add support for ini file. #363

Open lahabana opened 4 months ago

lahabana commented 4 months ago

Motivation:

In CI we have multiple invocations of muffet with mostly the same arguments. This is cumbersome to maintain all the other args. Thus we'd like to have support for a config file to use as default

Implementation:

Always use muffet.ini. I thought it was likely unecessary to support anything different until the need comes for it.

Signed-off-by: Charly Molter charly.molter@konghq.com

raviqqe commented 4 months ago

Hi. Thank you for the PR!

What OS do you use on CI? In your use cases, are scripts (shell scripts or batch files) not sufficient?

lahabana commented 4 months ago

It's all github actions:

https://github.com/kumahq/kuma-website/blob/b2087d57def4e5fa48cba9e2bded495315dbf59c/.github/workflows/ci.yml#L45-L77

We could make it a bash script but as you can see there's no checkout so we'd end up creating the bash file and then running it. It could work or we could have a config file like I'm adding here.

In any case it's your repo if you don't feel you need the added complexity of ini files feel free to close :)

PS: another alternative I thought about was EnvVars but this was tricky for repeated args (like include/exclude for example). Let me know if you prefer this/have a different idea.

raviqqe commented 4 months ago

We could make it a bash script but as you can see there's no checkout so we'd end up creating the bash file and then running it. It could work or we could have a config file like I'm adding here.

Sorry, I think I still don't understand how you want to use this feature. 😅 How do you put the .ini file into the CI jobs?

lahabana commented 4 months ago

I think we'd probably put a echo 'INI_CONTENT' > muffet.ini

raviqqe commented 4 months ago

Let's discuss this first in an issue! https://github.com/raviqqe/muffet/issues/365

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 66.66667% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 87.60%. Comparing base (61d5451) to head (a948e22). Report is 7 commits behind head on main.

Files Patch % Lines
arguments.go 75.00% 1 Missing and 1 partial :warning:
command.go 50.00% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #363 +/- ## ========================================== + Coverage 87.50% 87.60% +0.10% ========================================== Files 30 30 Lines 872 702 -170 ========================================== - Hits 763 615 -148 + Misses 88 64 -24 - Partials 21 23 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.