Skip to content

Commit 7ad1d9d

Browse files
committed
Make expected XML indentation comment less verbose
Thanks for the feedback @AliSoftware. See #332 (comment)
1 parent 27c7c6e commit 7ad1d9d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

spec/an_localize_libs_action_spec.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,13 @@
3737
end
3838

3939
def android_xml_with_content(content)
40-
# Under the hood, the code hardcodes the generated XML indentation as 4
41-
# spaces. Let's "force" it to be the same in here for consistency.
42-
#
43-
# See
44-
# https://github.com/wordpress-mobile/release-toolkit/blob/da405f2c5ca90d696857ba2ad01da2753daa60dc/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb#L67
45-
default_indentation = ' ' * 4
46-
4740
# I couldn't find a way to interpolate a multiline string preserving its
4841
# indentation in the heredoc below, so I hacked the following transformation
4942
# of the input that adds the desired indentation to all lines.
50-
indented_content = content.chomp.lines.map { |l| "#{default_indentation}#{l}" }.join
43+
#
44+
# The desired indentation is 4 spaces to stay aligned with the production
45+
# code applies when merging the XMLs.
46+
indented_content = content.chomp.lines.map { |l| " #{default_indentation}#{l}" }.join
5147

5248
return <<~XML
5349
<?xml version="1.0" encoding="UTF-8"?>

0 commit comments

Comments
 (0)