lingui / js-lingui

🌍 📖 A readable, automated, and optimized (3 kb) internationalization for JavaScript
https://lingui.dev
MIT License
4.54k stars 380 forks source link

lingui extract should fail with a non-zero exit code when there are extraction failures #1419

Open timofei-iatsenko opened 1 year ago

timofei-iatsenko commented 1 year ago

There was already a work on that: https://github.com/lingui/js-lingui/pull/1299

But still there are cases where errors just logged to console and zero code is returned.

For example, "Missing Message ID" warning.

What should be done:

We should add a flag to the cli extract, for example --strict which will exit with non-zero code in case of any extraction problems encountered.

Related: Look what hacks users have to do to achieve this: https://github.com/KlimaDAO/klimadao/blob/staging/scripts/lingui.js

landsman commented 1 year ago

I was thinking how to hot-fix this today as well.

timofei-iatsenko commented 1 year ago

Hi, we are currently reworked an entire codebase for cli and extractor in V4. And this task already scheduled for new upcoming release. So "hofixing" to the main branch wouldn't have a lot of sense. If you want to help, you can implement this for the "next" branch

andrii-bodnar commented 1 year ago

@thekip is this still relevant for the v4?

timofei-iatsenko commented 1 year ago

Yes. Few of the checks are still "warning only", the big changes should be made to the codebase to stop processing after encountering these warnings.

andrii-bodnar commented 1 year ago

It looks like it's not that critical and a big codebase change won't be worth it, what do you think?