在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):JustBlackBird/gulp-phpcs开源软件地址(OpenSource Url):https://github.com/JustBlackBird/gulp-phpcs开源编程语言(OpenSource Language):JavaScript 96.9%开源软件介绍(OpenSource Introduction):gulp-phpcs
Install
Usagevar gulp = require('gulp');
var phpcs = require('gulp-phpcs');
gulp.task('default', function () {
return gulp.src(['src/**/*.php', '!src/vendor/**/*.*'])
// Validate files using PHP Code Sniffer
.pipe(phpcs({
bin: 'src/vendor/bin/phpcs',
standard: 'PSR2',
warningSeverity: 0
}))
// Log all problems that was found
.pipe(phpcs.reporter('log'));
}); APIphpcs(options)options.binType: Default: PHP Code Sniffer executable. options.severityType: The minimum severity required to display an error or warning. This option is equivalent to Code Sniffer options.warningSeverityType: The minimum severity required to display an error or warning. This option is equivalent to Code Sniffer options.errorSeverityType: The minimum severity required to display an error or warning. This option is equivalent to Code Sniffer options.standardType: The name or path of the coding standard to use. One can use this option to specify custom This option is equivalent to Code Sniffer options.encodingType: The encoding of the files being checked. This option is equivalent to Code Sniffer options.reportType: The report type to generate. This option is equivalent to Code Sniffer options.showSniffCodeType: Display sniff codes in the report. This option is equivalent to Code Sniffer options.sniffsType: Filter for executed Sniffs This option is equivalent to Code Sniffer options.excludeType: Exclude some sniffs from ruleset. This option is equivalent to Code Sniffer options.ignoreType: Ignore a list of paths This option is equivalent to Code Sniffer options.cwdType: Set an explicit current working directory from which the options.colorsType: Pass colorized output of Code Sniffer to reporters. This option is equivalent to Code Sniffer Warning: This options is only compatible with 2.x branch of Code Sniffer. phpcs.reporter(name[, options])Loads one of the reporters that shipped with the plugin (see below). nameType: The name of the reporter that should be loaded. optionsType: Options for the reporter if needed. ReportersThe plugin only pass files through PHP Code Sniffer. To process the results of the check one should use a reporter. Reporters are plugins too, so one can pipe a files stream to them. Several repotrers can be used on a stream, just like any other plugins. These reporters are shipped with the plugin:
LicenseMIT © Dmitriy Simushev |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论