I've just uploaded PHP_CodeSniffer version 1.1.0a1, which contains 8 bug fixes and adds a load of new features including support for sniffing JavaScript files, an SVN pre-commit hook, integration with JSL and a new collection of sniffs that implement part of the PMD.
Thanks to everyone who has submitted bug reports and special thanks to Jack Bates for the pre-commit hook, Jan Miczaika for a new sniff and Manuel Pichler for bug fixes and the PMD sniffs.
You can view the full changelog, and download the release, on the package download page.
Showing posts with label JavaScript Lint. Show all posts
Showing posts with label JavaScript Lint. Show all posts
Monday, 21 April 2008
PHP_CodeSniffer 1.1.0a1 released
Posted by
Greg Sherwood
at
11:52 am
Tags: JavaScript Lint, PHP_CodeSniffer, PMD
Monday, 31 March 2008
PHP_CodeSniffer and JavaScript Lint
The new JavaScript tokenizer in PHP_CodeSniffer allows you to write your own custom JS sniffs, but JavaScript Lint already has a set of generic tests that can be applied to your code. Thanks to the JavaScript Lint command line tool, jsl, you can now include JavaScript Lint warnings and errors in your coding standards.
I've just committed the JavaScriptLint sniff into the Squiz standard under a new Debug category. The sniff requires you to have jsl installed on the same machine as PHP_CodeSniffer and you need to tell PHP_CodeSniffer where to find it.
$ phpcs --config-set jsl_path /path/to/jslJavaScript Lint checks for a number of common errors, including missing semi-colons and unused code. Like the Zend CodeAnalyzer sniff, not all errors and warnings need fixing, so all messages reported by jsl are warnings within PHP_CodeSniffer and can be hidden easily.
$ phpcs --standard=squiz /path/to/file.js
Posted by
Greg Sherwood
at
9:11 pm
Tags: JavaScript Lint, PHP_CodeSniffer
Subscribe to:
Posts (Atom)
