Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trailing tabs, too. #42

Closed
bionade24 opened this issue Dec 5, 2022 · 5 comments · Fixed by #43
Closed

Fix trailing tabs, too. #42

bionade24 opened this issue Dec 5, 2022 · 5 comments · Fixed by #43
Assignees
Labels
bug Something isn't working

Comments

@bionade24
Copy link

Fix tabs that lurk around, also in empty lines, too.

@andreasabel
Copy link
Member

Yes, we do, don't we?

transform
:: TabSize -- ^ Expand tab characters to so many spaces. Keep tabs if @<= 0@.
-> Text -- ^ Text before transformation.
-> Text -- ^ Text after transformation.
transform tabSize =
Text.unlines .
removeFinalEmptyLinesExceptOne .
map (removeTrailingWhitespace . convertTabs) .
Text.lines

@bionade24
Copy link
Author

From my bare understanding of the Haskell Code, it only removes trailing tabs if tabs get converted to spaces beforehand. I ran it with --tabs=0. If it's not the case, an example file it doesn't remove tabs on empty lines & trailing tabs is: https://github.com/bionade24/Realtek-rts5229-linux-driver/blob/master/rtsx.h

@andreasabel
Copy link
Member

Right, that likely got broken when the --tabs flag was added.
Thanks, hasn't occurred to me!

@andreasabel
Copy link
Member

This is being released as v0.0.11, in time for Nikolaus 2022. ;-)
Binaries should appear here: https://github.com/agda/fix-whitespace/releases/tag/v0.0.11

@andreasabel
Copy link
Member

Ooops, forgot Hackage release, done now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants