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

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


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)

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.

regards

Nicolas



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