walkingdexter/phpcs-diff

Removes non-diff violations from PHP_CodeSniffer reports.

2.0.0 2023-12-28 10:49 UTC

This package is auto-updated.

Last update: 2024-05-28 12:02:09 UTC


README

Removes non-diff violations from PHP_CodeSniffer reports. This is a lightweight solution with minimum requirements.

Installation

composer require --dev walkingdexter/phpcs-diff

Usage

Check current changes:

vendor/bin/phpcs-diff

This is a shortcut for:

vendor/bin/phpcs-diff --filter=GitModified

Check changes that have been staged for commit:

vendor/bin/phpcs-diff --filter=GitStaged

Check changes relative to the main branch:

vendor/bin/phpcs-diff --filter=GitCommitted --runtime-set git_diff_commit main

Check changes relative to a specific commit:

vendor/bin/phpcs-diff --filter=GitCommitted --runtime-set git_diff_commit 15a5e27

If the commit name is set in the configuration options:

vendor/bin/phpcs-diff --filter=GitCommitted

You can use any other options and arguments that the phpcs command accepts.

Limitations

Only reports that use prepared data are supported.