-
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
ignore_lines keys are not stringified from YAML #206
Comments
The keys in the example you've given are already strings: > require 'yaml'; YAML.load 'x: 1'
=> {"x"=>1}
> YAML.load <<-'YAML'
scanners:
- - "::I18n::Tasks::Scanners::PatternWithScopeScanner"
- exclude:
- "*.rb"
ignore_lines:
opal: ^\s*#(?!\si18n-tasks-use)
haml: ^\s*-\\s*#(?!\si18n-tasks-use)
coffee: ^\s*#(?!\si18n-tasks-use)
YAML
=> {"scanners"=>[["::I18n::Tasks::Scanners::PatternWithScopeScanner", {"exclude"=>["*.rb"], "ignore_lines"=>{"opal"=>"^\\s*#(?!\\si18n-tasks-use)", "haml"=>"^\\s*-\\\\s*#(?!\\si18n-tasks-use)", "coffee"=>"^\\s*#(?!\\si18n-tasks-use)"}}]]}
> YAML
=> Psych |
Ah, perhaps it's because of this: i18n-tasks/lib/i18n/tasks/used_keys.rb Line 88 in e8db4a1
|
Aha, good spot, always easier for someone familiar with the codebase to find the potential issue quicker :) Do you want me to try and add a PR? Would you prefer a solution around the config or the initializer? |
Your current solution ( |
Actually, scratch that, I'll fix it in a way that works for scanners other than pattern scanners |
Ah, other scanners don't have that setting |
Great - thanks for the prompt response! |
Released v0.9.6! |
When using the YML format for scanner configuration like:
The
ignore_lines
keys are not stringified, therefore when they hit the pattern scanner, they're not found.The fix is as simple as: markedmondson@17925c4
The text was updated successfully, but these errors were encountered: