1.1.0 ā€¢ Published 3 years ago

@sirbrillig/getphpcscoverage v1.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

getphpcscoverage

A cli tool which compares a dir with a phpcs config and reports files which are not checked.

Install

npm install -g @sirbrillig/getphpcscoverage

Usage

Usage
    $ getphpcscoverage [directoryPath]

  Specify a directory path which contains a phpcs.xml config file. This will
  report the files which will be scanned by the config file and those that will
  not.

  Options
    --help, -h  Show this help message
    --version, -v  Show the version
    --type <type>, -t <type>  Only examine files with this type extension (php, js, etc.)
    --format <format>, -f <format>  Set output type (human, json)

Example

$ tree testdir

testdir
ā”œā”€ā”€ phpcs.xml
ā””ā”€ā”€ src
    ā”œā”€ā”€ baz
    ā”‚Ā Ā  ā”œā”€ā”€ index-2.php
    ā”‚Ā Ā  ā””ā”€ā”€ index.php
    ā””ā”€ā”€ foobar
        ā”œā”€ā”€ index-2.php
        ā”œā”€ā”€ index-3.php
        ā””ā”€ā”€ index.php

$ cat testdir/phpcs.xml

<?xml version="1.0"?>
<ruleset name="TestRules">
 <description>Test library.</description>
 <rule ref="MyRuleset"/>
 <file>src/foobar</file>
 <file>src/baz/index-2.php</file>
</ruleset>

$ getphpcscoverage testdir

These files WILL be scanned by phpcs:
testdir/src/foobar/index-2.php
testdir/src/foobar/index-3.php
testdir/src/foobar/index.php
testdir/src/baz/index-2.php

These files WILL NOT be scanned by phpcs:
testdir/src/baz/index.php
1.1.0

3 years ago

1.0.0

3 years ago