timmerk / nfc-tools

Automatically exported from code.google.com/p/nfc-tools
0 stars 0 forks source link

Indent sources #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As it has been done in libnfc, it should be helpful to introduce a "make 
indent" target to indent correctly the code without a human review.

Original issue reported on code.google.com by romu...@libnfc.org on 3 Sep 2010 at 1:01

GoogleCodeExporter commented 9 years ago
Some labels missed.

Original comment by romu...@libnfc.org on 3 Sep 2010 at 1:02

GoogleCodeExporter commented 9 years ago
I'll take it!

Original comment by romain.t...@gmail.com on 3 Sep 2010 at 4:56

GoogleCodeExporter commented 9 years ago
After trying unsuccessfuly to find a gindent(1) configuration that does not 
mess-up the ASCII art, I gave up and read the vim documentation about cindent & 
co.

As a result, setting "cino=t0(0:0" along with cindent fits my coding habits, 
and a file can be fully reindented in a few keystrokes.

vim configuration snippet:

-----8<--------------------------
filetype plugin indent on
set cino=t0(0:0
-----8<--------------------------

The to reindent a document, open it and 'gg=G' ('gg' → Go to the first line, 
'=' → indent to …, 'G' → go to the last line)

I had to change a few things so that the are indented nicely, but there are 
some "dangerous" macros that can't be written in a way they would not be 
unindented by indent (BUFFER_INIT redefinition for Mifare DESFire), so for now, 
I have not looked for a 'make indent' target.

Original comment by romain.t...@gmail.com on 4 Sep 2010 at 9:09

GoogleCodeExporter commented 9 years ago
See r567 r568 r569

Original comment by romain.t...@gmail.com on 4 Sep 2010 at 9:10

GoogleCodeExporter commented 9 years ago

Original comment by romain.t...@gmail.com on 29 Sep 2011 at 2:30