Hi, > -----Original Message----- > From: jakub....@gmail.com [mailto:jakub....@gmail.com] On Behalf Of Jakub > Zelenka > Sent: Sunday, October 29, 2017 7:41 PM > To: Nikita Popov <nikita....@gmail.com> > Cc: PHP internals <internals@lists.php.net> > Subject: Re: [PHP-DEV] Consistent indentation for test files > > On Sat, Oct 28, 2017 at 12:59 PM, Nikita Popov <nikita....@gmail.com> wrote: > > > Hi internals, > > > > Right now we do not have a consistent standard for the indentation of > > PHPT files. Some people create space-indented files, others create > > tab-indented files. Over time, indentation invariably starts to mix, > > because developers with different indentation settings work on one file. > > > > Here are the current statistics for code in .phpt files: > > > > total: 15515 > > prefer tabs: 4273 (27.5%) > > prefer spaces: 6307 (40.7%) > > draw: 77 (0.5%) > > no indentation: 4858 (31.3%) > > > > There are 1824 (11.8%) files that contain mixed tab and space indentation. > > The indentation was determined based on the first character of a line. > > > > I would like to propose that we establish a common standard by > > a) using space indentation for all future tests (as they currently > > form the majority), and > > > > I usually use tabs for phpt as it's a bit simpler with my IDE that I use for > PHP core > dev (QtCreator) and mostly the core exts that I work with had tabs. That said > I > wouldn't be against making it the same and use spaces everywhere if we also > start using PSR-2 for tests - it's not just an indentation that is a mess... > > > > b) reindenting existing test files to use space indentation. > > > > > +1 but it needs to be done in the lowest active branch otherwise it will > result in conflicts when changing existing tests (it is sometimes useful for > extending tests)... > Whichever way would be chosen, implementing a pre commit hook would make sense to be done. To mention, tabs were easier for me, too, but not a big deal anyway.
Regards Anatol