Standardized indentation?

I noticed that many gnuradio files (gmsk.py for example) contain an
unholy mix of spaces and tabs for indentation. Is there any easy way
to standardize our indentation? Many text editors can make it so
hitting tab creates 4 spaces instead of the tab character.

(I like 4 spaces per indent, what about you guys?)

On Thu, Jun 05, 2008 at 05:03:39PM -0400, Steven C. wrote:

I noticed that many gnuradio files (gmsk.py for example) contain an
unholy mix of spaces and tabs for indentation. Is there any easy way
to standardize our indentation? Many text editors can make it so
hitting tab creates 4 spaces instead of the tab character.

(I like 4 spaces per indent, what about you guys?)

PEP 8 – Style Guide for Python Code | peps.python.org

I like 4 spaces per indent too. What I don’t like is people who think
that a TAB character in a file should ever expand to anything other
than the next mod-8 boundary :wink:

It’s the source of much confusion in the new world.

To live happily in the GNU Radio source code universe (python, C++,
assembler, whatever), your editor should be setup so that a TAB
character in the file expands to the next mod-8 boundary. What
happens when you press the TAB key on the keyboard in your favorite
editor is up to you. Mine is programmed to “indent correctly” using
the minimum number of characters chosen from the set {SPACE,TAB} :wink:
emacs rules!

In summary: we agree about the 4-space indentation per level in
python. However it’s extremely unlikely that we’ll modify 200k lines
of code to use only spaces or only tabs in any given file.

Eric

Some incantation like

indent -br -brs -cdw -ce -cs -hnl -i2 -lp -nbad -nbbo -nprs -psl -saf
-sai
-saw -nss -npcs

works well for most C-ish code. Substitute -i4 if you don’t use
graduated
lenses in your glasses.

Frank

Steven C. wrote:

I noticed that many gnuradio files (gmsk.py for example) contain an
unholy mix of spaces and tabs for indentation. Is there any easy way
to standardize our indentation? Many text editors can make it so
hitting tab creates 4 spaces instead of the tab character.

You can fix these files with the expand tool.

(I like 4 spaces per indent, what about you guys?)

Raw tab characters for me. You can configure your editor to display the
tab as any width. And you can always convert the code to spaced based
indentation with expand.

-Josh