Results 23 comments of Łukasz Rogalski

My intuitive argumentation was following: - darker is just diff-based `black` - if `black` crashes on input file and bails out, `darker` can (and should) bail out as well. This...

Last time I read about that, Levenstein was supposedly best. There is C-extension: https://pypi.org/project/Levenshtein/ I am unsure how well maintained that is or if public API is fully interchangeable.

Btw. I still like my heuristic to treat whitespace-only lines as junk. A lot of code in the world already use empty lines to split code into "somewhat" independent sections....

https://github.com/akaihola/darker/blob/ac4f2b0fdee1cc1d9739fd99686283ca08ee5666/src/darker/diff.py#L92 Something along the lines below of should do the trick: ``` matcher = SequenceMatcher(lambda line: all(char in string.whitespace for char in line), src.lines, dst.lines, autojunk=False) ``` Please note that...

Silly idea, maybe we should delegate computing diffs to `git` binary itself? (`git diff --no-index f1.py f2.py`) We have to create some temporary files, but algorithm itself should be already...

I'm not sure why coverage dropped.

@PCManticore most definitely, Python3 will be improved, thanks for your comments!

@PCManticore How would I reasonably infer arguments of function call? Covering only kwargs/only args/unpacking/defaults etc. will be tricky. Is `CallSite` something which may be used here?

It needs more work, but conceptually it's much closer to final patch comparing to previous one. Coverage drop is due to guard clauses not being hit.