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

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

Merged
merged 4 commits into from
Dec 8, 2022

Conversation

decafdennis
Copy link
Contributor

lingui extract prints extraction failures (such as Cannot process file [path]: Different defaults for the same message ID.) to the console but then finishes with a zero exit code. When run unattended in a CI job, this means files with failures are skipped during extraction and their messages may then be missing in a production build.

This PR propagates the boolean result(s) from the extractor all the way up into the CLI command. There was already code to handle it and do process.exit(1) when the result is false.

@vercel
Copy link

vercel bot commented Nov 11, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
js-lingui ❌ Failed (Inspect) Nov 11, 2022 at 11:07PM (UTC)

@decafdennis decafdennis changed the title lingui extract should fail have a non-zero exit code when there are extraction failures lingui extract should fail with a non-zero exit code when there are extraction failures Nov 11, 2022
@codecov
Copy link

codecov bot commented Nov 11, 2022

Codecov Report

Base: 82.52% // Head: 82.47% // Decreases project coverage by -0.04% ⚠️

Coverage data is based on head (3a5612c) compared to base (7c85cb7).
Patch coverage: 75.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1299      +/-   ##
==========================================
- Coverage   82.52%   82.47%   -0.05%     
==========================================
  Files          56       56              
  Lines        1785     1792       +7     
  Branches      500      503       +3     
==========================================
+ Hits         1473     1478       +5     
  Misses        184      184              
- Partials      128      130       +2     
Impacted Files Coverage Δ
packages/cli/src/api/catalog.ts 84.95% <75.00%> (-0.44%) ⬇️
packages/cli/src/api/extractors/index.ts 57.89% <75.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@decafdennis decafdennis changed the title lingui extract should fail with a non-zero exit code when there are extraction failures improvement: lingui extract should fail with a non-zero exit code when there are extraction failures Nov 14, 2022
@semoal semoal changed the title improvement: lingui extract should fail with a non-zero exit code when there are extraction failures feat: lingui extract should fail with a non-zero exit code when there are extraction failures Dec 8, 2022
@semoal semoal merged commit c863322 into lingui:main Dec 8, 2022
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.

2 participants