On Wed, Jun 24, 2009 at 5:07 PM, Raymond Feng <[email protected]> wrote:
> Hi, > > We have an agreed Eclipse template, why can't people have the code > formatting done using the code style in the 1st place? > The code style/format has come up several times over the years, there never has been complete agreement, the eclipse template we have checked in to svn doesn't even match the idea one we also have checked in. From what I recall the last time formatting was discussed the general consensus was mainly things like: when you're updating code try to match the format its already in, don't use excessively long lines, and don't use tabs. I think we have to be a little tolerant of formatting, even if absolutely everyone uses the eclipse template its easy for it to get dropped off and not noticed when someone gets a new machine, or does a new IDE install. > I agree not to reformat the whole file at the same time when we fix the > code, but I don't think we go too far. I have a few things set up > automatically in Eclipse: > > * Organize the imports Organise imports is fine IMHO as its a small number of lines all at the very top thats easy to skip over as we don't need to think about the changes too much. > * Convert the tab/space > I'd _really_ prefer you not do this automatically as it really does make it harder to see what you're doing. When tabs/spaces is wrong in a file its often wrong on lots of lines so a commit for even just a small change can end up with quite a big diff of several screens full which we need to scroll full hunting for the actual changes. > > It helps me a lot to maintain the clean code with disturbing the diffs too > much. > If we do the thing you suggest next then i don't think the not doing tabs/spaces conversion automatically will be such a problem for you as most of the files will be fine as they get fixed up regularly. > > The other thing, can we reformat the whole code base before we cut a RC so > that we can have good style moving forward? > For the tabs/spaces conversion and organize imports, yes lets, thats a good idea. I'd happy to do this when I'm RM for a release if we can find an easy way to do it, and actually doesn't even need to be just for a release, we could run a tabs/spaces conversion and organize imports across the entire trunk when ever anyone gets the urge to do it or someone notices a few files have gone wrong. I'm less keen on a complete format as the eclipse formatter just doesn't seem that good IMHO so things like comments don't get auto formatted particularly well. > > Thanks, > Raymond > -------------------------------------------------- > From: "ant elder" <[email protected]> > Sent: Wednesday, June 24, 2009 7:02 AM > To: <[email protected]> > Subject: Re: Commit comment quality? > > On Wed, Jun 24, 2009 at 2:27 PM, Luciano Resende<[email protected]> >> wrote: >> >>> On Tue, Jun 23, 2009 at 11:36 PM, ant elder<[email protected]> wrote: >>> >>>> >>>> Does anyone disagree that commits should not mix formatting and code >>>> changes? >>>> >>>> >>> There are some settings on the Eclipse templates we use that do some >>> conversion automatically (e.g tabs for spaces)... are those accepted >>> ? >>> >> >> I'd don't think those should be done automatically and from other >> projects its standard practice to to keep those separate in another >> commit. We're all busy so reviewing changes should be able to be done >> as quick and easily as possible, so ideally just read the comment and >> a quick flick over the diff, if that diff includes many other lines of >> change even just for tab/space changes it makes it harder than >> necessary to see the actual code lines changed. >> >> ...ant >> > >
