Re: On Tabs and Spaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Witten <mfwitten@xxxxxxx> wrote:
> What are the rules about tabs and spaces in source code?
> 
> I'm having a terrible time with formatting,
> especially in the perl scripts; there is a
> mix of spaces and tabs.
> 
> from what I can deduce, single tabs are used
> to introduce the equivalent of 8 spaces while
> 4 explicit spaces are used for half a tab.

The C code is all tabs, with the tabs set at 8 spaces, but the
actual tab width isn't too important here as we never use the tab
for alignment beyond the left indent.

The bulk of the Perl/shell is also done that way, but you may
run into a place where it isn't.  In which case try to match the
existing identation within that block as best as you can so the diff
is minimal and the resulting file still indents just as good/bad
as it did before.

You may also consider submitting a whitespace correction patch in
front of your actual code change to correct the offending part of
the file, but every line you touch is that much more work for your
peers to review and test.  In short changing code is bad unless
there is a really compelling reason...

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux