-
Notifications
You must be signed in to change notification settings - Fork 84
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
Implemented having comments in CSV #99
base: master
Are you sure you want to change the base?
Conversation
test/babelish/test_android2csv.rb
Outdated
expected_output = [{"app_name" => "android2csv", "action_greetings" => "Hello", "ANOTHER_STRING" => "testEN", "empty" => ""}, | ||
{"app_name" => "This is the app name", "action_greetings" => "This is a greeting", | ||
"ANOTHER_STRING" => "This is another string", "empty" => "This is an empty string"}] | ||
output = Babelish::Android2CSV.new.load_strings "test/data/android-comments.xml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [84/80]
test/babelish/test_android2csv.rb
Outdated
def test_load_strings_with_comments | ||
expected_output = [{"app_name" => "android2csv", "action_greetings" => "Hello", "ANOTHER_STRING" => "testEN", "empty" => ""}, | ||
{"app_name" => "This is the app name", "action_greetings" => "This is a greeting", | ||
"ANOTHER_STRING" => "This is another string", "empty" => "This is an empty string"}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align the elements of a hash literal if they span more than one line.
Line is too long. [92/80]
Space inside } missing.
test/babelish/test_android2csv.rb
Outdated
@@ -27,6 +27,14 @@ def test_initialize | |||
assert_equal filenames, converter.filenames | |||
end | |||
|
|||
def test_load_strings_with_comments | |||
expected_output = [{"app_name" => "android2csv", "action_greetings" => "Hello", "ANOTHER_STRING" => "testEN", "empty" => ""}, | |||
{"app_name" => "This is the app name", "action_greetings" => "This is a greeting", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align the elements of an array literal if they span more than one line.
Space inside { missing.
Line is too long. [89/80]
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
@@ -27,6 +27,14 @@ def test_initialize | |||
assert_equal filenames, converter.filenames | |||
end | |||
|
|||
def test_load_strings_with_comments | |||
expected_output = [{"app_name" => "android2csv", "action_greetings" => "Hello", "ANOTHER_STRING" => "testEN", "empty" => ""}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space inside { missing.
Line is too long. [130/80]
Space inside } missing.
Trailing whitespace detected.
comments[node["name"]] = previous_comment if previous_comment | ||
previous_comment = nil | ||
end | ||
if node.comment? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use next to skip iteration.
def parse_comment_line(line) | ||
line.strip! | ||
if line[0] != ?# && line[0] != ?= | ||
m = line.match(/^\/\*(.*)\*\/\s*$/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use %r around regular expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@netbe This function I copied from strings2csv.rb, so unsure if I should still change this according to houndci-bot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dchau95 yes please make any change @houndci-bot mention and add tests to check comments on android
@@ -6,22 +6,40 @@ def initialize(args = {:filenames => []}) | |||
super(args) | |||
end | |||
|
|||
def parse_comment_line(line) | |||
line.strip! | |||
if line[0] != ?# && line[0] != ?= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use the character literal - use string literal instead.
test/babelish/test_android2csv.rb
Outdated
"empty" => "This is an empty string" | ||
} | ||
] | ||
output = Babelish::Android2CSV.new.load_strings "test/data/android-comments.xml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [84/80]
test/babelish/test_android2csv.rb
Outdated
"ANOTHER_STRING" => "This is another string", | ||
"empty" => "This is an empty string" | ||
} | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent the right bracket the same as the start of the line where the left bracket is.
test/babelish/test_android2csv.rb
Outdated
"action_greetings" => "This is a greeting", | ||
"ANOTHER_STRING" => "This is another string", | ||
"empty" => "This is an empty string" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent the right brace the same as the start of the line where the left brace is.
test/babelish/test_android2csv.rb
Outdated
"app_name" => "This is the app name", | ||
"action_greetings" => "This is a greeting", | ||
"ANOTHER_STRING" => "This is another string", | ||
"empty" => "This is an empty string" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
{ | ||
"app_name" => "This is the app name", | ||
"action_greetings" => "This is a greeting", | ||
"ANOTHER_STRING" => "This is another string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
"action_greetings" => "Hello", | ||
"ANOTHER_STRING" => "testEN", | ||
"empty" => "" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent the right brace the same as the start of the line where the left brace is.
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
"app_name" => "android2csv", | ||
"action_greetings" => "Hello", | ||
"ANOTHER_STRING" => "testEN", | ||
"empty" => "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
{ | ||
"app_name" => "android2csv", | ||
"action_greetings" => "Hello", | ||
"ANOTHER_STRING" => "testEN", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
expected_output = [ | ||
{ | ||
"app_name" => "android2csv", | ||
"action_greetings" => "Hello", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
def test_load_strings_with_comments | ||
expected_output = [ | ||
{ | ||
"app_name" => "android2csv", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
@Dchau95 Thks for the contrib, just getting back from vacation, I ll have a look soon |
Android XML load strings does not load comments, whereas iOS Strings loads comments. Merely trying to mirror both platform strings conversion.