haskell / alex

A lexical analyser generator for Haskell
https://hackage.haskell.org/package/alex
BSD 3-Clause "New" or "Revised" License
297 stars 82 forks source link

Doc: Split lines by punctuation #207

Closed Ericson2314 closed 2 years ago

Ericson2314 commented 2 years ago

This might look weird at first, but unlike wrapping based on line length, wrapping based on punction is "stable" across edits. This is important, because we it means we can have readable diffs without drifting away from a (quasi) normal form.

andreasabel commented 2 years ago

This looks like a stab in the right direction. Rewrapping based on line length causes spurious diffs which are hard to process visually.

This would even be better if references (stuff insided backquotes) weren't wrapped but kept on one line. Search and replace for bulk-fixing references works much easier if they do not span several lines (because matches usually end and the eol).

Did you do this with a tool? Maybe it can be configured to treat stuff bracketed by backquotes as monolithic?

Ericson2314 commented 2 years ago

I didn't realize some references were still split. I certainly didn't mean them to be.

Did you do this with a tool?

I wish! :)