-
Notifications
You must be signed in to change notification settings - Fork 264
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
remove-unused don't remove whole files #260
Comments
Can you demonstrate this by adding a failing integration test here? If not, there could be a problem in your config. |
In order to demonstrate it I have to add new file in the fixtures which breaks a lot of tests for various reasons, but currently the relevant one is diff --git a/spec/i18n_tasks_spec.rb b/spec/i18n_tasks_spec.rb
index 7972c1e..c020200 100644
--- a/spec/i18n_tasks_spec.rb
+++ b/spec/i18n_tasks_spec.rb
@@ -360,6 +360,7 @@ resolved_reference_target.a (resolved ref)
fs = fixtures_contents.merge(
'config/locales/en.yml' => { 'en' => en_data }.to_yaml,
+ 'config/locales/devise.en.yml' => { 'en' => { 'unused' => en_data['unused'] } }.to_yaml,
'config/locales/es.yml' => { 'es' => es_data }.to_yaml,
# test that our algorithms can scale to the order of {BENCH_KEYS} keys.
'vendor/heavy.file' => Array.new(BENCH_KEYS) { |i| "t('bench.key#{i}') " }.join |
Thanks for the test case! I think the commit linked above fixes it. Please try the version from
This seems to have been fixed by the commit above as well. I've opened (and closed) a separate issue #262 to track this in case it hasn't been fixed completely. |
This fix is potentially dangerous as if someone adds external gem in read section of the config it may end up cleaning up gems. |
This was the behaviour before the fix as well.
Yes, please open a separate issue about the other issue. |
You're right, thanks for fixing this one. |
I use
pattern_router
by default and have my translations split in couple of files for different components. But when I remove a componentremove-unused
always leaves some translations in the file and never removes it or leaves it empty. These leftovers are then reported as unused, but still can't be removed automatically as it should remove the file, but it doesn't. Another problem that may be related is when you have file that has no mapping inwrite
section and all its translations are unused,remove-unused
will leave it intact.The text was updated successfully, but these errors were encountered: