phpro / grumphp

A PHP code-quality tool
MIT License
4.15k stars 431 forks source link

Text indentation missing? #590

Closed ChrisButterworth closed 5 years ago

ChrisButterworth commented 5 years ago
Q A
Version 0.14.3
Bug? Maybe
New feature? no
Question? yes
Documentation? yes

Is there a way to get GrumPHP to test indentation?

Happy with all the other errors and warning but this one seems to be completely missing; here's my configuration in case anything is missing

parameters:
    git_dir: .
    bin_dir: _dev/vendor/bin
    tasks:
      phpcs:
        standard: PSR2
        tab_width: 4
        severity: 1
        warning_severity: 1
        triggered_by: [php]
janvernieuwe commented 5 years ago

What do you mean precisely, i tried to reproduce it, but when i have bad indentation, phpcs will complain. For example

    /**
     * @param SoapClient      $soapClient
     * @param EventDispatcherInterface $dispatcher
     */
    public function __construct(SoapClient $soapClient, EventDispatcherInterface $dispatcher)
    {
    $this->soapClient = $soapClient;
    $this->dispatcher = $dispatcher;
    }

will result in:

FILE: ...anvernieuwe/Projects/soap-client/src/Phpro/SoapClient/Client.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 40 | ERROR | [x] Line indented incorrectly; expected at least 8
    |       |     spaces, found 4
 41 | ERROR | [x] Line indented incorrectly; expected at least 8
    |       |     spaces, found 4
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
ChrisButterworth commented 5 years ago

So I have a _dev folder that contains my vendor directory with grumphp running in the parent but it doesn't catch anything that isn't in my index.php or any text indentation issues.

janvernieuwe commented 5 years ago

Hi @ChrisButterworth ,

Sorry it took so long, I made a test case in this repo https://github.com/janvernieuwe/grumphp-issue590 It seems to be working for me, can you edit this repo to reproduce it?