Commit d0051ac
committed
fix: say when a config file is skipped for lack of TOML support (#268)
#371 stopped docformatter crashing with a NameError when neither tomllib
nor the tomli backport is importable, by returning early from
_do_read_toml_configuration. That fixed #368. What is left is #268: the
early return is completely silent, so a pyproject.toml -- including one
passed explicitly with --config -- is ignored without a word, and the run
looks like it simply chose to reformat differently.
This is reachable on a supported configuration. pyproject.toml declares
python = "^3.10", tomli is an optional extra for python < 3.11, and the CI
matrix still runs 3.10 and pypy3.9. A plain `pip install docformatter` on
3.10 therefore reads no TOML configuration at all.
Print one line to stderr naming the file that was not read and how to get
TOML support, and leave the behaviour itself alone -- whether the settings
should be honoured some other way is a separate question.1 parent d5c7b77 commit d0051ac
2 files changed
Lines changed: 56 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
350 | 357 | | |
351 | 358 | | |
352 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
0 commit comments