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

Feature/pretty json #132

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Feature/pretty json #132

wants to merge 9 commits into from

Conversation

netbe
Copy link
Owner

@netbe netbe commented Jun 8, 2020

Superseeds #109. rebased with master

expected_json = File.read("test/data/" + expected_json_filename)
converter = Babelish::CSV2JSON.new(csv_file,
{ "English" => "en" },
output_basename: "output",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/AlignParameters: Align the parameters of a method call if they span more than one line.
Layout/TrailingWhitespace: Trailing whitespace detected.


expected_json = File.read("test/data/" + expected_json_filename)
converter = Babelish::CSV2JSON.new(csv_file,
{ "English" => "en" },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/AlignParameters: Align the parameters of a method call if they span more than one line.
Layout/TrailingWhitespace: Trailing whitespace detected.

given_json_filename = "output.json"

expected_json = File.read("test/data/" + expected_json_filename)
converter = Babelish::CSV2JSON.new(csv_file,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/TrailingWhitespace: Trailing whitespace detected.

expected_json = File.read("test/data/" + expected_json_filename)
converter = Babelish::CSV2JSON.new(csv_file,
{ "English" => "en" },
output_basename: "output",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/AlignParameters: Align the parameters of a method call if they span more than one line.
Layout/TrailingWhitespace: Trailing whitespace detected.


expected_json = File.read("test/data/" + expected_json_filename)
converter = Babelish::CSV2JSON.new(csv_file,
{ "English" => "en" },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/AlignParameters: Align the parameters of a method call if they span more than one line.
Layout/TrailingWhitespace: Trailing whitespace detected.

given_json_filename = "output.json"

expected_json = File.read("test/data/" + expected_json_filename)
converter = Babelish::CSV2JSON.new(csv_file,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/TrailingWhitespace: Trailing whitespace detected.

@@ -1,3 +1,3 @@
module Babelish
VERSION = "0.6.5"
VERSION = "0.6.4"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/MutableConstant: Freeze mutable objects assigned to constants.

@@ -31,6 +31,7 @@ class Commandline < Thor
method_option :ignore_lang_path, :type => :boolean, :aliases => "-I", :lazy_default => false, :desc => "Ignore the path component of langs"
method_option :fetch, :type => :boolean, :desc => "Download file from Google Drive"
method_option :sheet, :type => :numeric, :desc => "Index of worksheet to download. First index is 0"
method_option :pretty_json, :type => :boolean, aliases: "-p", desc: "Prettify your json output files"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
Metrics/LineLength: Line is too long. [105/80]

:filenames => filenames })
csv_filename: csv_filename,
headers: headers,
filenames: filenames })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/MultilineHashBraceLayout: Closing hash brace must be on the line after the last hash element when opening brace is on a separate line from the first hash element.

:csv_filename => csv_filename,
:headers => headers,
:filenames => filenames })
csv_filename: csv_filename,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/IndentHash: Use 2 spaces for indentation in a hash, relative to the first position after the preceding left parenthesis.

@@ -116,7 +116,7 @@ def test_create_csv_file
filename = "test_data"
strings = {filename => {"ERROR_HANDLER_WARNING_DISMISS" => "OK", "ANOTHER_STRING" => "hello"}}

converter = Babelish::Strings2CSV.new(:headers => %w{variables english}, :filenames => [filename])
converter = Babelish::Strings2CSV.new(headers: %w{variables english}, filenames: [filename])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [96/80]

@@ -105,7 +105,7 @@ def test_load_strings_with_genstrings_file
end

def test_dotstrings_to_csv
converter = Babelish::Strings2CSV.new(:filenames => ["test/data/test_data.strings"])
converter = Babelish::Strings2CSV.new(filenames: ["test/data/test_data.strings"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [85/80]

:filenames => filenames })
csv_filename: csv_filename,
headers: headers,
filenames: filenames })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/MultilineHashBraceLayout: Closing hash brace must be on the line after the last hash element when opening brace is on a separate line from the first hash element.

@@ -63,7 +63,7 @@ def test_converting_csv_to_dotstrings_default_lang_to_key
spanish_file = "es.lproj/Localizable.strings"
converter = Babelish::CSV2Strings.new(csv_file,
{'English' => [:en], "French" => "fr", "German" => "de", "Spanish" => "es"},
:default_lang => "variables")
default_lang: "variables")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/AlignParameters: Align the parameters of a method call if they span more than one line.

@@ -30,7 +30,7 @@ def test_converting_csv_to_dotstrings_default_lang
spanish_file = "es.lproj/Localizable.strings"
converter = Babelish::CSV2Strings.new(csv_file,
{'English' => [:en], "French" => "fr", "German" => "de", "Spanish" => "es"},
:default_lang => "English")
default_lang: "English")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/AlignParameters: Align the parameters of a method call if they span more than one line.

@@ -14,8 +14,8 @@ def test_converting_csv_to_dotstrings_one_output_option
single_file = 'myApp.strings'
converter = Babelish::CSV2Strings.new(csv_file,
{'English' => [:en]},
:output_basename => 'myApp',
:ignore_lang_path => true)
output_basename: 'myApp',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/AlignParameters: Align the parameters of a method call if they span more than one line.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -16,8 +16,8 @@ def test_converting_csv_to_dotstrings_one_output_option
single_file = 'myApp.php'
converter = Babelish::CSV2Php.new(csv_file,
{'English' => "en"},
:output_basename => 'myApp',
:ignore_lang_path => true)
output_basename: 'myApp',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/AlignParameters: Align the parameters of a method call if they span more than one line.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -16,12 +16,48 @@ def test_converting_csv_to_dotstrings_one_output_option
single_file = 'myfile.json'
converter = Babelish::CSV2JSON.new(csv_file,
{'English' => "en"},
:output_basename => 'myfile',
:ignore_lang_path => true)
output_basename: 'myfile',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/AlignParameters: Align the parameters of a method call if they span more than one line.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

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.

3 participants