Re: [hatari-devel] Proposal to introduce a configuration for a code formatting tool

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Donnerstag, den 15.12.2011, 17:46 +0100 schrieb Nicolas Pomarède: 
> Le 15/12/2011 17:35, Matthias Arndt a écrit :
> > Hello together,
> >
> > as my recent joystick subsystem patch triggered another case of coding
> > style and formatting, I want to make a proposal.
> >
> > To keep formatting and indenting of the code clean and always the same,
> > I suggest that we add a fixed configuration file for a formatting tool
> > like Artistic Style or GNU Indent to the repository.
> >
> > That way every user could reformat any C file to a defined Hatari
> > standard. This could fix things like "indent with 8 spaces instead TAB
> > characters" and deal with placement of braces.
> >
> > I even think that esp Artistic Style allows to keep current settings
> > unless configured to change them.
> >
> > Regards,
> > Matthias
> 
> Hello
> 
> this problem was raised some times ago, and the consensus was that given 
> the different styles along the files (due to various contributors over 
> time) a unique style was not enforced.
> 
> I don't have anything against gnu indent, but in some special cases, 
> fine tuning it exactly to what we like could be quite difficult.
> 
> Also, I'm against reformatting the whole source tree, some indents might 
> be "bad", but the people who maintain those parts are used to it and can 
> more easily work on the source when needed (for example, the whole cpu 
> emulation uses completly different style)

I personally think that it helps a lot of files always have the same
look and feel. I don't intend to touch all parts of the code so it can
be fine for me.

> 
> Of course, completly new files should follow the style from "main.c" or 
> "sound.c" for example, which have similar formatting.
> 
> But regarding indenting, the idea was "follow the existing style of the 
> file you're modifying". It will be often simpler than trying to set up a 
> complete rules file for gnu indent.

Seeing the "existing style" is sometimes very hard to see. I even think
the whole code was formatted to 4 spaces already. At least that aligned
okaish in Code::Blocks.

> regards
> 
> Nicolas
> 

Matthias
-- 
Matthias Arndt <marndt@xxxxxxxxxxxxxx>
PGP-Key: http://www.final-memory.org/files/marndt.asc
Jabber: simonsunnyboy@xxxxxxxxxxxxxxxx




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/