Thread: [Libphidget-devel] make indent
Status: Alpha
Brought to you by:
jstrohm
|
From: Vadim T. <vt...@fr...> - 2002-09-08 02:29:24
|
Hello, I'm going to introduce two top-level targets: make indent make indent-local First one indents all the .c, .h and .cc files according to ./indent.rules file content (so the CVS stays consistent), and the second will indent all the files according to current user's $HOME/.indent.pro content. OK? --vt |
|
From: Jack S. <js...@ja...> - 2002-09-08 03:02:26
|
On Sat, 2002-09-07 at 21:29, Vadim Tkachenko wrote: > Hello, > > I'm going to introduce two top-level targets: > > make indent > make indent-local > > First one indents all the .c, .h and .cc files according to ./indent.rules > file content (so the CVS stays consistent), and the second will indent all > the files according to current user's $HOME/.indent.pro content. > sounds good to me. Have you worked with indent before? I haven't. |
|
From: Vadim T. <vt...@fr...> - 2002-09-08 04:09:39
|
According to Jack Strohm: > On Sat, 2002-09-07 at 21:29, Vadim Tkachenko wrote: > > Hello, > > > > I'm going to introduce two top-level targets: > > > > make indent > > make indent-local > > > > First one indents all the .c, .h and .cc files according to ./indent.rules > > file content (so the CVS stays consistent), and the second will indent all > > the files according to current user's $HOME/.indent.pro content. > > > sounds good to me. Have you worked with indent before? I haven't. Just a little bit, but reading the man page once, carefully, is enough. This is what I'll do: I'll commit the things *related* to indent, however, I will not do 'make indent' before commiting the changes, so you have a chance to play around with $HOME/.indent.pro and see what kind of indentaion you like. As for the project, I'd say just go with --gnu-style... Maybe with minor modifications. Funny thing, though, indent breaks the very long return statements in the switch statement in phidget.c, so that has to be fixed manually - but just the first time... --vt |
|
From: Jack S. <js...@ja...> - 2002-09-08 07:17:17
|
On Sat, 2002-09-07 at 23:09, Vadim Tkachenko wrote: > According to Jack Strohm: > > On Sat, 2002-09-07 at 21:29, Vadim Tkachenko wrote: > > > Hello, > > > > > > I'm going to introduce two top-level targets: > > > > > > make indent > > > make indent-local > > > > > > First one indents all the .c, .h and .cc files according to ./indent.rules > > > file content (so the CVS stays consistent), and the second will indent all > > > the files according to current user's $HOME/.indent.pro content. > > > > > sounds good to me. Have you worked with indent before? I haven't. > > Just a little bit, but reading the man page once, carefully, is enough. > > This is what I'll do: I'll commit the things *related* to indent, however, I > will not do 'make indent' before commiting the changes, so you have a chance > to play around with $HOME/.indent.pro and see what kind of indentaion you > like. > > As for the project, I'd say just go with --gnu-style... Maybe with minor > modifications. > > Funny thing, though, indent breaks the very long return statements in the > switch statement in phidget.c, so that has to be fixed manually - but just > the first time... how does this affect CVS. if I check something out, then run make indent-local, edit a few things. How do I check the code back in. make indent cvs commit if so, does that mean CVS will check every file into version control, because they all have changes (at least the data on the file has). Just wondering . . . |
|
From: Vadim T. <vt...@fr...> - 2002-09-08 08:16:58
|
According to Jack Strohm: > if I check something out, then run make indent-local, edit a few > things. How do I check the code back in. > > make indent > cvs commit > > if so, does that mean CVS will check every file into version control, > because they all have changes (at least the data on the file has). > > Just wondering . . . The proper sequence is like this: cvs get/update make indent-local hack away make indent cvs commit There'll be one massive commit because all the code has to be brought to compliance, and then the diffs will become civilized. The only thing is to just remember to do 'make indent' before 'cvs commit' ;) Along the Ant lines, it may be a good idea to create 'make commit', though the usefulness will be limited due to the fact that you may want to commit one file. Another solution is to integrate the indentation with CVS, though I don't remember how to do it and have to read the SourceForge docs again. Did 'make indent' break things on your boxes? I'm still wondering *why* does it break the return statements the first time, but not subsequent... Another thing - I might make 'make indent' slower, but smarter - right now, if I do it twice in a row, even though the files are identical, the timestamp changes, and it'll recompile all the project. It's relatively easy to avoid it. So it works for you, right? Time to 'make indent && cvs commit'? --vt |
|
From: Jack S. <js...@ja...> - 2002-09-08 13:54:10
|
On Sun, 2002-09-08 at 03:16, Vadim Tkachenko wrote: > According to Jack Strohm: > > > if I check something out, then run make indent-local, edit a few > > things. How do I check the code back in. > > > > make indent > > cvs commit > > > > if so, does that mean CVS will check every file into version control, > > because they all have changes (at least the data on the file has). > > > > Just wondering . . . > > The proper sequence is like this: > > cvs get/update > make indent-local > hack away > make indent > cvs commit ok. > > There'll be one massive commit because all the code has to be brought to > compliance, and then the diffs will become civilized. The only thing is to > just remember to do 'make indent' before 'cvs commit' ;) Along the Ant > lines, it may be a good idea to create 'make commit', though the usefulness > will be limited due to the fact that you may want to commit one file. > Another solution is to integrate the indentation with CVS, though I don't > remember how to do it and have to read the SourceForge docs again. > > Did 'make indent' break things on your boxes? I'm still wondering *why* does > it break the return statements the first time, but not subsequent... everything seemed to work for me. > > Another thing - I might make 'make indent' slower, but smarter - right now, > if I do it twice in a row, even though the files are identical, the > timestamp changes, and it'll recompile all the project. It's relatively easy > to avoid it. yeah > > So it works for you, right? Time to 'make indent && cvs commit'? yep! |
|
From: Vadim T. <vt...@fr...> - 2002-09-08 18:57:07
|
Jack Strohm wrote: > > > So it works for you, right? Time to 'make indent && cvs commit'? > > yep! Duck! --vt |