On Sat, Oct 28, 2017 at 5:42 AM, Christoph M. Becker <cmbecke...@gmx.de>
wrote:

> On 28.10.2017 at 13:59, Nikita Popov wrote:
>
> > 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.
>
> Thanks for bringing this up!
>
> > 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
> > b) reindenting existing test files to use space indentation.
>
> +1
>
> I'm rather baffled that <http://qa.php.net/write-test.php> doesn't
> address this issue at all.
>
> --
> Christoph M. Becker
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Those stats can be a bit misleading, though, as I've observed that many (if
not most) IDEs are configured to automatically convert tab characters to
spaces.  Therefore, it stands to reason that at least some of the "prefer
spaces" category would actually fall under "prefer tabs".  I suspect the
tabs and spaces groups are much closer together, though it's impossible to
say how much since there's no way to control for that variable.  Still, I
would caution people not to read too much into those statistics.

A common standard would be nice, but I fear it might discourage some from
contributing tests.  Also, how would we actually enforce this?  Would we
reject any tests that don't conform to this or fix them, ourselves?  Either
way, it would require someone to actually do the work.  Another possible
option would be to use some kind of automated conversion process.  But I
personally think these solutions are more trouble than they're worth.  So
long as the spacing is consistent within each file, I can live with it.

--Kris

Reply via email to