tasklwIP - A Lightweight TCP/IP stack - Tasks: task #6597, Cleaner source code regulations...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #6597: Cleaner source code regulations are needed

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Thu 08 Mar 2007 11:39:30 AM UTC
   
 
Category:  None Should Start On:  Thu 08 Mar 2007 12:00:00 AM UTC
Should be Finished on:  Thu 08 Mar 2007 12:00:00 AM UTC Priority:  1 - Later
Status:  Done Privacy:  Public
Assigned to:  None Percent Complete:  80%
Open/Closed:  Closed Planned Release:  None
Effort:  0.00

Jump to the original submission

Mon 18 Jun 2007 07:58:56 PM UTC, comment #12: 

I'll close this now as we have a clear explanation of how it should be (doc/contrib.txt) and except for ppp, everything seems fine to me!

Simon Goldschmidt <goldsimon>
Group administrator
Fri 08 Jun 2007 02:30:50 PM UTC, comment #11: 

I think the code is pretty good formatted by now...

What remains is mainly the ppp code, since none of the developers are using this...

Simon Goldschmidt <goldsimon>
Group administrator
Thu 12 Apr 2007 01:02:06 AM UTC, comment #10: 

Ok, I understand, I will try to separte them...

Frédéric Bernon <fbernon>
Group Member
Thu 12 Apr 2007 12:54:13 AM UTC, comment #9: 


>If I understand the problem, your diff tools dosen't have any
> options to not compare whitespaces and lines feed? That what I
> do now when I provide patch files (and that's why you don't
> have see indent in one of my last patch file).


indent can move things between lines too.

e.g. for Simon's suggested use of indent it will change:
  if (x)
  {
     foo(x);
  }
to:
  if (x) {
    foo(x);
  }

GNU diff -w reports these as different. More importantly, so does cvs diff -w.

As for doing it separately... it is better to be separate, that's all. But it's probably better it gets done at all, than it doesn't, if that makes a difference.


Jonathan Larmour <jifl>
Group Member
Thu 12 Apr 2007 12:41:24 AM UTC, comment #8: 


>Otherwise when you diff specific CVS revisions, you can't easily see what is just a whitespace change, and what is a commit that actually changes code.


If I understand the problem, your diff tools dosen't have any options to not compare whitespaces and lines feed? That what I do now when I provide patch files (and that's why you don't have see indent in one of my last patch file).

Except that, I'm agree with you, it will be better to do separate commits, but there is no lot of developers to do such tasks.

But I will try to separate them next time (if I don't forget, of course)...




Frédéric Bernon <fbernon>
Group Member
Wed 11 Apr 2007 11:28:10 PM UTC, comment #7: 

Some other projects I am involved in are quite insistent you commit whitespace and indent changes in separate cvs commits all by themselves. Otherwise when you diff specific CVS revisions, you can't easily see what is just a whitespace change, and what is a commit that actually changes code.

Also be sure to manually check what indent does - sometimes layout isn't straightforward, particularly cosmetically with comments and if you have slightly strange constructs with conditionally compiled code.

Jonathan Larmour <jifl>
Group Member
Thu 22 Mar 2007 06:41:08 PM UTC, comment #6: 

Just for your information, I have reindent some part of code (api_msg, api_lib...) during last patchs, but there is lot of job again...

Frédéric Bernon <fbernon>
Group Member
Mon 12 Mar 2007 08:53:44 AM UTC, comment #5: 

Hmm, someone else mentioned something about CVS converting automatically.  I'm not sure about that.  Try to check in Unix linebreaks if possible.

Kieran Mansley <kieranm>
Group Member
Sun 11 Mar 2007 05:26:14 PM UTC, comment #4: 

It's a CRLF line termination in most of files, but I don't know if it's Windows or Unix style...

If I remember, Unix is only <LF>, Mac only <CR> and Windows <CRLF>.

So, I supose we use Windows Style (but not sure)...

Frédéric Bernon <fbernon>
Group Member
Sun 11 Mar 2007 05:05:42 PM UTC, comment #3: 

Either a comment on line termination characters is missing contrib.txt (or some other file) or I don't find it. What ar we using, Windows or Unix linebreaks?

Savannah Web-CVS shows me Unix-style, Windows TortoiseCVS shows me windows-style... I'm confused!

Simon Goldschmidt <goldsimon>
Group administrator
Fri 09 Mar 2007 09:45:37 AM UTC, comment #2: 

I always afraid to let a software change a source code automaticlly. But if you're sure about it...

Isn't it better to clean up indentation and code style when we commit some patchs (even if I known that Kieran prefer separate item, but he "knows how it is easier to clean these things up while you're working on something")?

Because checking in one time all the code after "ident" will take time...

Frédéric Bernon <fbernon>
Group Member
Thu 08 Mar 2007 11:42:37 AM UTC, comment #1: 

I've not used indent before, so can't comment on whether it is a suitable tool or the args you suggest, but a clean up of the indentation and code style would be welcome.

Kieran Mansley <kieranm>
Group Member
Thu 08 Mar 2007 11:39:30 AM UTC, original submission:  

Hi all,

I think we need cleaner source code layout regulations.
Don't get me wrong, I like the current source code style as stated in contrib.txt, but it's not followed everywhere.

I'd like to use GNU indent for that purpose:
indent -bli0 -br -ce -npcs <file>
seems to give the results we want.

Any objection to use indent before every checkin and to use it to clean up the current code?

Simon Goldschmidt <goldsimon>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jifl (Posted a comment)
  • -email is unavailable- added by fbernon (Posted a comment)
  • -email is unavailable- added by kieranm (Posted a comment)
  • -email is unavailable- added by goldsimon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-06-18 goldsimon StatusNone Done
        Open/ClosedOpen Closed
    2007-06-08 goldsimon Percent Complete50% 80%
    2007-05-17 goldsimon Percent Complete0% 50%

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code