stellarwp/nexcess-coding-standards 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

stellarwp/nexcess-coding-standards

Composer 安装命令:

composer require stellarwp/nexcess-coding-standards

包简介

The Nexcess Coding Standard for PHP_CodeSniffer

README 文档

README

The Nexcess Coding Standard is a set of PHP_CodeSniffer rules for Nexcess PHP and WordPress projects.

Requirements

  • PHP 7.4+

Installation

This package should be installed as a development dependency for your project:

$ composer require --dev stellarwp/nexcess-coding-standards

After installation, the standard is available to PHPCS as Nexcess.

Project Ruleset

To use this ruleset, create a phpcs.xml.dist in the root of the project and add the following content:

<?xml version="1.0"?>
<ruleset>
	<arg name="basepath" value="." />
	<arg name="extensions" value="php" />
	<arg name="severity" value="4" />
	<arg name="tab-width" value="4" />
	<arg name="parallel" value="80" />
	<arg name="colors" />

	<!-- Update to the PHP version your production/local docker container runs on. -->
    <config name="testVersion" value="8.0" />
	<!-- php -r 'echo PHP_VERSION_ID;' -->
    <config name="php_version" value="80022" />

	<!-- Fix WordPress typing breaking PHPCS. -->
	<config name="minimum_supported_wp_version" value="7.0" />

	<!-- Ignore warnings, show progress of the run and show sniff names. -->
	<arg value="nps" />

	<!-- Directories to be checked. -->
	<file>./wp-content/plugins/core</file>
	<file>./wp-content/themes/core</file>
	<file>./wp-content/mu-plugins</file>

	<!-- Exclude files. -->
	<exclude-pattern>*-config.php</exclude-pattern>
	<exclude-pattern>*vendor/</exclude-pattern>
	<exclude-pattern>*tests/*</exclude-pattern>
	<exclude-pattern>*.twig</exclude-pattern>
	<exclude-pattern>*webpack/</exclude-pattern>

	<!-- Include the Nexcess coding standard. -->
	<rule ref="Nexcess" />
</ruleset>

Add phpcs.xml to your .gitignore.

Manual Usage

PHPCS

$ ./vendor/bin/phpcs --standard=Nexcess /path/to/files/**.php

PHPCBF

$ ./vendor/bin/phpcbf --standard=Nexcess /path/to/files/**.php

License

This library is licensed under the terms of the MIT license.

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 11
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固