Minor tweaks prepping for adding diff support#27
Conversation
pmolodo
commented
Feb 24, 2026
- add filter_decorate_diff
- pandoc_ast_diff.py: add progress bar
- remove extra / overridden --from pandoc arg
| "--defaults", | ||
| spec, | ||
| combined, | ||
| "--from=gfm+", |
There was a problem hiding this comment.
Could you please point to where is this re-used or overwritten? Thanks.
There was a problem hiding this comment.
tools/pandoc_ast_diff.py
Outdated
| import argparse | ||
| from typing import List, Dict, Any, Tuple | ||
|
|
||
| from tqdm import tqdm |
There was a problem hiding this comment.
I'm not against adding additional external dependencies per se, but this specific use case seems to be used mostly for debugging and rather noisy otherwise.
There was a problem hiding this comment.
IMO some sort of progress indicator is pretty necessary - running ast_diff on my 64-core machine took ~6 minutes... which is a long time to have a terminal sit with no output. Any user without prior knowledge of the tool is bound to wonder if it's hanging.
If you really don't like the external dependency, we can remove it, and write a manual/ugly one, but I do think we need some sort of progress indicator.
Also, tqdm is a fairly small dependency, with 0 dependencies of it's own:
https://pypi.org/project/tqdm/
tqdm does not require any dependencies (not even curses!), just Python and an environment supporting carriage return \r and line feed \n control characters.
Compared to, ie, pandoc, it's a pretty negligible additional footprint...
There was a problem hiding this comment.
Hmm... on second thought - decided to take a look at how hard it would be to speed up the LCS computation, and it turned out to be very simple:
With that change, there's not really a need for a progress bar anymore, so I'll remove that commit.
|
LGTM |