Commit 0957623
committed
Make
`merge_strings` prefixed keys with line-based regexes that assume the key, `=`, and value
are adjacent, so an inter-token `.strings` comment — `AppName /* c */ = WordPress;` or
`CFBundleName = WordPress /* trailing */;` — broke the match and the key was written to the
merged file without the prefix, while the `plutil`-derived bookkeeping still recorded it
*with* the prefix. The inconsistency could resurface the very collisions the prefix exists
to avoid (two files sharing a key behind a comment merged to a single colliding key).
Replace the regexes with `StringsFileValidationHelper.prefix_keys`, a comment-aware
tokenizer that reuses the same state machine `find_duplicated_keys` uses: it prefixes a key
wherever the tokenizer enters one, regardless of surrounding comments, and leaves
`key = value`-looking text inside a comment alone. Bookkeeping and rewriting now agree by
construction. Fixes the failing specs added in #742.merge_strings key prefixing comment-aware1 parent 95e64bb commit 0957623
3 files changed
Lines changed: 53 additions & 18 deletions
File tree
- lib/fastlane/plugin/wpmreleasetoolkit/helper/ios
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
Lines changed: 7 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
119 | 109 | | |
120 | 110 | | |
121 | 111 | | |
| |||
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
211 | 256 | | |
212 | 257 | | |
213 | 258 | | |
| |||
0 commit comments