Custom Interactive Strategies code sniffer ruleset for Drupal projects.

Installs: 353

Dependents: 0

Suggesters: 0

Security: 0

Type:phpcodesniffer-standard

2.0.7 2024-03-15 17:44 UTC

This package is not auto-updated.

Last update: 2024-04-26 18:24:23 UTC


README

This package defines customized Code Sniffer rules for Drupal projects. It is primarily based on drupal/coder, with some sniffs excluded and others downgraded to warnings. Some additional sniffs not provided in drupal/coder have also been added.

Installing the ruleset

Use Composer to install the ruleset and its dependencies as a package:

composer require --dev interactivestrategies/drupal-cs

Making the IS rules the default for your project

Add a phpcs.xml.dist file in your project with content like this:

<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="an_is_project">
  <file>./dist/modules/custom</file>
  <file>./dist/profiles/custom</file>
  <file>./dist/themes/custom</file>

  <rule ref="ISDrupal"/>
</ruleset>

The tag(s) define what paths the rules should be applied to/within.