-
Notifications
You must be signed in to change notification settings - Fork 12
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
Request: no-mixed-spaces mode #19
Comments
So how would you handle (say) a line that started with
Last time I checked, Linux kernel devs want hard tabs for offsetting indented blocks (so that individual devs can customize their width), and spaces for matching continuation lines (visually lining up), e.g.
If you change those spaces on the second line to tabs, I expect you're gonna get your patches rejected. Once you decide how to resolve the ambiguity, and if you still want it… this should be easy to implement. Patches welcome :) |
Good question! I hadn't thought about that. If it were me, I would expand the tabs to N spaces, then reslice from the beginning. So
I've seen some of that code as well. I'm trying to be a good corporate citizen (as it were) and follow statements like "spaces are never used for indentation" here and "[l]ine up argument lists by tabs, not spaces" here. If you know other guidance overriding those, please let me know! |
Please see attached foo.txt. Line 2 has fifteen leading spaces. Running
wtf -v -s -y 8 foo.txt | xxd -g1
changes the first 8 spaces to a tab and leaves the last 7 spaces:
I would like to request a mode in which any trailing group of spaces after a leading group of tabs would be converted to a single tab. Unlike
-y N
, this would convert every group of up toN
spaces to a tab.The use case is Linux kernel coding, which uses hard tabs. I care more about consistency than exact-column indentation. clang-format will give me tab+space mix, and I'd like to use wtf to convert those last few spaces to one additional tab per line.
Thanks for considering this request!
The text was updated successfully, but these errors were encountered: