add --config to specify config file location #394
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are running I18n checks for our backend translations and also for for frontend JS files. We do have a seperated config file for those and had a rspec test like this
Since our test suite is big and takes a while (~1 hour) on CI , we don't want to waste resources anymore, only to realize after the test run, that a translation key is missing. Quite inefficient and unnecessary. We looked for a way to also run the config file for our JS checks via shell command, but that wasn't possible.
We found a way of actually adding the config file to the health check. Since this gem actually relies heavily on the config file before it does anything else, i had to inject the config file loadup right at the beginning.
Most likely this PR won't be accepted and if there are just minor things that are missing i'm happy to take on them, but i fear that it's a bigger architecture problem. Maybe there are better ways to actually implement this which i didn't find on my first try.
If this won't get merged, maybe somebody else might stumble across this and it's helpful for him, or at least this PR is acting as an inspiration for future progress.
We can call this now with
i18n-tasks health
(default config location) andì18n-tasks health --config config/i18n-js-yml
(for our JS tasks)