Commit 09c6e37
feat(to): table also for xlsx and ods (#3580)
* feat(to): Also support --table for xlsx/ods and validate names
Add examples to the xlsx/ods help showing --table usage and stdin support. Extend the --table help text to clarify it applies to postgres/sqlite and xlsx/ods and document name rules and limits. Change validation so --table is disallowed for datapackage but allowed for xlsx/ods; add sheet-name checks (xlsx max 31 chars, disallow \ / * [ ] : ?) while keeping postgres/sqlite identifier checks (start with letter/underscore, alnum/_ only, max 63). Wire up apply_table_rename when processing xlsx and ods inputs so provided table/sheet names are applied during conversion.
* tests(to): add tests for to --table for xlsx/ods
Co-Authored-By: Claude <claude@users.noreply.github.com>
* fix(to): enforce 31-char sheet name limit for ODS and use char count
- Apply the 31-character sheet name limit to both xlsx and ods (previously
xlsx only), matching ODF spec conventions
- Use chars().count() instead of len() for character-based length checking,
so multi-byte UTF-8 names aren't rejected prematurely
- Add test for ODS sheet name exceeding 31 characters
- Update help text to clarify limit applies to both formats
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* tests(to): improve to --table test reliability
- Fix xlsx too_long test to use "a".repeat(32) instead of "a]".repeat(16)
which contained forbidden chars, masking the length validation check
- Add output file existence assertions to xlsx and ods happy-path tests
to ensure the command actually produces the expected file
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs(to): update help md and TOC
* typo: ODF -> ODS
* refactor(to): addl xlsx/ods validation per Copilot review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* tests(to): tighten tests per Copilot low-confidence suggestion
* fix(to): avoid double command execution in xlsx/ods happy path tests
`assert_success` and `output` both call `cmd.output()`, running the
command twice. Replace with a single `output()` call followed by an
inline status assertion, eliminating redundant execution and potential
side-effect issues from the second run.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude <claude@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent fc7835f commit 09c6e37
File tree
4 files changed
+205
-37
lines changed- docs/help
- src/cmd
- tests
4 files changed
+205
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
138 | 148 | | |
139 | 149 | | |
140 | 150 | | |
| |||
156 | 166 | | |
157 | 167 | | |
158 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
159 | 179 | | |
160 | 180 | | |
161 | 181 | | |
| |||
215 | 235 | | |
216 | 236 | | |
217 | 237 | | |
218 | | - | |
| 238 | + | |
219 | 239 | | |
220 | 240 | | |
221 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
112 | 120 | | |
113 | 121 | | |
114 | 122 | | |
| |||
129 | 137 | | |
130 | 138 | | |
131 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
132 | 148 | | |
133 | 149 | | |
134 | 150 | | |
| |||
175 | 191 | | |
176 | 192 | | |
177 | 193 | | |
178 | | - | |
179 | | - | |
| 194 | + | |
| 195 | + | |
180 | 196 | | |
181 | | - | |
182 | | - | |
183 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
184 | 202 | | |
185 | 203 | | |
186 | 204 | | |
| |||
276 | 294 | | |
277 | 295 | | |
278 | 296 | | |
279 | | - | |
| 297 | + | |
280 | 298 | | |
281 | | - | |
| 299 | + | |
282 | 300 | | |
283 | 301 | | |
284 | 302 | | |
285 | 303 | | |
286 | 304 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
302 | 338 | | |
303 | 339 | | |
304 | 340 | | |
| |||
335 | 371 | | |
336 | 372 | | |
337 | 373 | | |
| 374 | + | |
338 | 375 | | |
339 | 376 | | |
340 | 377 | | |
341 | 378 | | |
342 | 379 | | |
343 | 380 | | |
344 | 381 | | |
| 382 | + | |
345 | 383 | | |
346 | 384 | | |
347 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
534 | | - | |
535 | | - | |
536 | | - | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
537 | 571 | | |
538 | 572 | | |
539 | 573 | | |
540 | 574 | | |
541 | 575 | | |
542 | 576 | | |
543 | | - | |
| 577 | + | |
544 | 578 | | |
545 | 579 | | |
546 | 580 | | |
547 | 581 | | |
548 | 582 | | |
549 | | - | |
550 | | - | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
551 | 606 | | |
552 | 607 | | |
553 | 608 | | |
554 | 609 | | |
555 | | - | |
556 | | - | |
557 | | - | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
558 | 613 | | |
559 | 614 | | |
560 | 615 | | |
561 | 616 | | |
562 | 617 | | |
563 | 618 | | |
564 | | - | |
| 619 | + | |
565 | 620 | | |
566 | 621 | | |
567 | 622 | | |
568 | 623 | | |
569 | 624 | | |
570 | | - | |
571 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
572 | 682 | | |
573 | 683 | | |
574 | 684 | | |
| |||
588 | 698 | | |
589 | 699 | | |
590 | 700 | | |
591 | | - | |
| 701 | + | |
592 | 702 | | |
593 | 703 | | |
594 | 704 | | |
| |||
0 commit comments