byteever/byteever-sniffs

ByteEver PHP Coding Standards

Installs: 349

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:phpcodesniffer-standard

v1.0.1 2023-10-25 04:55 UTC

This package is auto-updated.

Last update: 2024-04-25 06:14:50 UTC


README

Collection of PHP_CodeSniffer sniffs for ByteEver.

Installation

composer require byteever/byteever-sniffs

Usage

Command line

$ ./vendor/bin/phpcs .

If relying on Composer, edited the composer.json file by adding the following:

	"scripts" : {
		"lint": [
			"phpcs ."
		],
	}

Then lint via:

$ composer run lint

IDE Integration

Some IDE integrations of PHPCS fail to register the ByteEver-Default ruleset. In order to rectify this, place .phpcs.xml.dist at your project root:

<?xml version="1.0"?>
<ruleset name="ByteEver Coding Standards">
	<description>My projects ruleset.</description>

	<!-- Configs -->
	<config name="minimum_supported_wp_version" value="4.7" />
	<config name="testVersion" value="7.2-" />

	<!-- Rules -->
	<rule ref="ByteEver-Defaults" />

	<rule ref="WordPress.WP.I18n">
		<properties>
			<property name="text_domain" type="array" value="new-text-domain" />
		</properties>
	</rule>

	<rule ref="PHPCompatibility">
		<exclude-pattern>tests/</exclude-pattern>
	</rule>
</ruleset>