Re: What about a indent target?
"Jack O'Quin" <[email protected]>
| Newsgroups | gmane.comp.audio.jamin.devel |
|---|---|
| Message-ID | <[email protected]> |
On 5/14/07, Emmanuel Saracco <[email protected]> wrote: > Le lundi 14 mai 2007 à 05:55 -0500, Jack O'Quin a écrit : > > > On 5/14/07, Emmanuel Saracco <[email protected]> wrote: > > > Hi, > > > > > > I saw that "indent" was used after the dynamic creation of "state.h". > > > > > > What about a "indent" target for all the source code, automatically used > > > on "dist-all" target call before application packaging? > > > > > > If you are ok, just apply the following tiny patch (change the > > > ".indent.pro" content to fit your coding rules): > > > > > > * Added "indent" target in "Makefile.am" > > > > > > * Added ".indent.pro" for "indent" options > > > > > > Yes, "esthetic" only, again... :-) > > > > Not just aesthetic: seems like it could interact badly with > > CVS, making source files appear modified when they are > > not. > > It was just a idea to deal with different coding style of each > developer. > > > If the indentation of our code is bad enough to need this, > > Sure it is not! > > > why not just fix it in the CVS tree? > > It is just that I have seen some little difference between coding styles > in the CVS tree and I was wondering if it should be fixed permanently > with something like "indent" automation. > > It is because I am wondering myself which coding style I should adopt > when submitting JAMin's patches. Fo myself I always use the "gnu" coding > style, but it seems that JAMin's developers use "kb" style. Right? > > It was just another "new JAMin contributor" idea of the day, nothing > more :-) Consistency is more important than any particular choice of coding indentation style. I used the "stroustrup" indentation style in my portions of jamin, because it seemed to fit better with what the others were doing. That is the emacs (c-set-style) indent option with 4-character indentation. Though It works fine, I never used it for any other project. I generally use either "bsd" or "gnu" styles. The "gnu" style is mostly compatible if you always place '{' and '}' on separate lines, effectively giving 4-char indentation to the inner block. That is mostly what I do these days. The main thing is to copy the style of any source file when making modifications. I have no objection to someone reformatting my code and committing the changed version to CVS, as long as it is at least as readable as the original. That can be done safely, by comparing the compiled binaries of the before and after versions. If nothing changed (except maybe a date field), then nothing was broken and the new version inherits all the testing that had gone before. -- joq ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/