Modify ↓
#823 closed enhancement (fixed)
[PATCH] Add PHP linting tool for CodeSniffer
Reported by: | chirila.s.alexandru@… | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 0.7 |
Component: | Recipe commands | Version: | dev |
Keywords: | Cc: | tony@… | |
Operating System: |
Description
This patch adds support for parsing the output of CodeSniffer and to include it in the report. (similar to the python:pylint tool)
Example recipe:
<build xmlns:php="http://bitten.edgewall.org/tools/php" xmlns:svn="http://bitten.edgewall.org/tools/svn" xmlns:sh="http://bitten.edgewall.org/tools/sh"> <step id="checkout"> <svn:checkout url="svn://localhost/" path="${path}" revision="${revision}" username="harry" password="test" /> </step> <step id="lint" onerror='ignore'> <sh:exec file="phpcs" args='--report=full --report-width=150 .' output="phpcs.out" /> <php:phpcs file="phpcs.out" /> </step> </build>
Attachments (2)
Change History (7)
Changed 11 years ago by chirila.s.alexandru@…
comment:1 Changed 11 years ago by Tony Meyer <tony@…>
- Cc tony@… added
comment:2 Changed 11 years ago by osimons
Changed 11 years ago by Alexandru Chirila <chirila.s.alexandru@…>
comment:3 Changed 11 years ago by Alexandru Chirila <chirila.s.alexandru@…>
Attached a new patch, that also contains tests and documentation for this feature.
~/bitten-trunk$ python bitten/build/tests/phptools.py .......... ---------------------------------------------------------------------- Ran 10 tests in 0.036s OK
Please note that this tool only has two types of messages WARNING and ERROR. Let me know if I can help with anything else.
comment:4 Changed 11 years ago by osimons
- Milestone set to 0.7
- Resolution set to fixed
- Status changed from new to closed
Thanks again! Committed in [1023].
As I don't use PHP I can only hope others will find this superb patch useful ;-)
comment:5 Changed 11 years ago by osimons
Windows fix committed in [1025].
Note: See
TracTickets for help on using
tickets.
Unit tests documenting format and successful reading would do wonders for chances of getting this committed. I'm not familiar with PHP or this tool, so tests are essential for understanding what it does and how.
Also, don't forget to include documentation for the new tool in doc\commands.txt.