HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Beware the 4-spacening this week (25 May)
Linc
Admin
This week we will be converting Vanilla to a 4-space indent system from our current 3-space indent system per the coding standard we adopted last year. This is for our pull request authors - if you're in the middle of something, this change will undoubtedly cause a merge conflict. A diff program like Kaleidoscope should help you easily resolve it, but it will be a little extra work.
2
Comments
If people like to develop in a different standard, you can set up in/out filters
This is not the exact example but the some of the to things you can do:
http://alexzaytsev.me/2014/10/19/git-filter-to-convert-spaces-to-tabs-and-vice-versa/
When I develop on a project that uses tabs I use filters so I can use spaces, and it converts to tabs when I push, and back to spaces when pulling.
I also use other filters such trimming whitespace off end of lines and empty lines.
grep is your friend.
@x00 That's a good idea. I use tabs all the time, I don't like "hard" spaces. A filter to go from one to the other will definitely be useful.
My shop | About Me
@businessdad follow the example
~/.gitconfig
and
.git/info/attributes
grep is your friend.
Thanks @x00. In my case, I will try to transform spaces to tabs locally, and tabs to spaces on commit.
My shop | About Me
That is basically what
clean
andsmudge
does.I would covert your files to tabs anyway, becuase when they covert it to four spaces, you tabs will covert to the correct spaces. Which is a bit more complicated with mixed scenario.
grep is your friend.
I use
spaces2tabs
on tab projects, becuase I'm a spaces guy.I'm a spaces guy becuase I have an aversion to arrows, and like little grey dots.
grep is your friend.
I hide those characters, so it doesn't make a difference to me, from that perspective.
My shop | About Me
It is not right to hide those characters. what is wrong with you business dad? :shivers:
grep is your friend.
He likes his world full of wonder and mistery. Is it a space? A tab? Who knows? (doing jazz hands) Mistery...
It seems most if not all coding standard all spaces now a day. Some 2x, some 4x but I can understand the use of space is more universality across platform and IDE. I use various editor for the task and by using spaces it would be more consistent in any IDE.
We're probably going to wait until Monday or Tuesday to do this because we currently have a runaway pull request that needs to get merged first.
It's perfectly right, they are just noise anyway. They are called "invisible characters" for a reason.
My shop | About Me
Except that with tabs you can make them look as you like. For example, I don't like four spaces, too "wide". With hard spaces, there's nothing to do, apart from the usual search and replace. With tabs, you can tell the editor to show one tab as two spaces, and you're ready to go. If you like four spaces, you can still set the editor accordingly.
My shop | About Me
This works perfectly fine for indentation purposes. If you are trying to make your code look pretty and use tabs, bad things can happen if the tab is narrower than expected. At this point it is really splitting hairs.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Not a mistery, in fact I replace all the leading spaces with tabs before I start on some "foreign" code. So the indentation is always a tab, no mystery.
This discussion is becoming philosophical...
My shop | About Me
tabs are nice only if you is the only person work on your code and you only use one editor but if there are lot of people working the code and use various editor, tabs can create headache and look ugly too!
https://github.com/vanilla/vanilla/pull/2783
We played O Fortuna in the office as it began, then 2001 Space Odyssey. Then we ran out of epic songs and the non-devs started to give us the stink eye.
Are you using an IDE code formatting function to update the files?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.