Last modified: 2014-03-24 23:43:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T65041, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 63041 - phplint should detects PHP files not having the .php suffix
phplint should detects PHP files not having the .php suffix
Status: NEW
Product: Wikimedia
Classification: Unclassified
Continuous integration (Other open bugs)
wmf-deployment
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-24 23:07 UTC by Antoine "hashar" Musso (WMF)
Modified: 2014-03-24 23:43 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2014-03-24 23:07:25 UTC
I have sent a PHP fatal error in the scap repository (fix: https://gerrit.wikimedia.org/r/#/c/120692 )

EBernhardson wrote:

other repositories run the php linter, could this one too?  Since not everything has the .php extension it would probably have to use the magic number(ala /usr/bin/file) to decide or some such.



I guess find / file / xargs php -l would do the job indeed. If you can come up with the shell commands to have it happen I will be more than happy.

We currently use the phplint macro which is:

      bin/git-changed-in-head php php5 inc phtml module install  | xargs -n1 -t php -l

http://git.wikimedia.org/blob/integration%2Fjenkins-job-builder-config.git/f630f86f77b4afe1384b4d8bf3d5f0e02cae49ac/macro.yaml#L453


git-changed-in-head comes from integration/jenkins.git which is intended to provides files having changed in HEAD (obviously :D).
Comment 1 Erik Bernhardson 2014-03-24 23:43:21 UTC
First stab at a line:

find ./ -type f -print0 | xargs -0 file -k | grep 'PHP script' | cut -d : -f 1 | xargs -n 1 php -l


Will see if it can be a bit cleaner.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links