-
-
Notifications
You must be signed in to change notification settings - Fork 511
Open
Description
Description
The i18n lint:scripts command always exits with code 8 on 64-bit systems when there are 0 missing translations, instead of exiting with code 0.
The bug is in lib/i18n-js/cli/lint_scripts_command.rb at line 140:
exit(missing_count.size)This calls Integer#size on missing_count, which returns the number of bytes needed to store the integer value (8 on 64-bit systems), rather than the integer itself.
How to reproduce
- Set up a project with i18n-js configured with
lint_scriptspatterns - Ensure all translations are present (0 missing)
- Run
bundle exec i18n lint:scripts - Observe the exit code:
echo $?returns8
$ bundle exec i18n lint:scripts
=> Config file: "./config/i18n.yml"
=> Require file: "./config/environment.rb"
=> Node: "/usr/local/bin/node"
=> Available locales: [:en]
=> Patterns: ["app/frontend/**/*.ts", "app/frontend/**/*.tsx"]
=> 172 translations, 0 missing, 0 ignored
$ echo $?
8What do you expect
When there are 0 missing translations, the command should exit with code 0 (success).
What happened instead
The command exits with code 8 because 0.size returns 8 on 64-bit systems (the number of bytes needed to store an Integer).
Suggested fix
Change line 140 from:
exit(missing_count.size)To:
exit(missing_count)Software:
- Gem version: 4.2.4
- Ruby version: 3.4.7 (also reproducible on other versions)
Full backtrace
N/A - no exception is raised, the bug is in the exit code logic
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels