Skip to content

helsingborg-stad/phpcs

Repository files navigation

PHP_CodeSniffer rules for Helsingborg Stad

Installation

Run the following from the root of your project:

composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer require --dev helsingborg-stad/phpcs

Available rulesets

Hbg-WordPress

Specific ruleset for WordPress themes and plugins.

Example Usage

<?xml version="1.0"?>
<ruleset name="Some Wordpress Plugin">
    <file>./source/php</file>
    <file>./tests</file>
    <rule ref="Hbg-WordPress"></rule>
</ruleset>

Available composer binaries

Included are 2 binaries for running phpcs and phpcbf on changed files only. The changes in the current branch are compared to supplied branch, and are meant to be used in a CI environment.

Examples

vendor/bin/phpcs-changed origin/main

This example runs phpcs on all changed files in the current branch compared to origin/main.

vendor/bin/phpcbf-changed origin/main

This example runs phpcbf on all changed files in the current branch compared to origin/main.

About

PHP_CodeSniffer rulesets supporting the coding standards for the Helsingborg Stad organization

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages