brainsum / drupal-dev-tools

Tools for Drupal development.
5 stars 1 forks source link

[Support request] "The option show_warnings does not exist" #3

Closed balu-ertl closed 5 years ago

balu-ertl commented 5 years ago

After installation with Composer within a project (EL) I wanted to test how the checks run by trying to commit with an obviously fault message: $ git commit -m "DAM-00 - Ez most nem lenne szabad beengednie" However I stumbled upon into an issue when checking process arrives to Phpcs (occuring both in- and outside of the Docker container):

wodby@php.container:/var/www/html $ php ./vendor/bin/grumphp git:pre-commit
GrumPHP detected a pre-commit command.
GrumPHP is sniffing your code!
Running task 1/3: Composer... ✔
Running task 2/3: Phpcs...
In OptionsResolver.php line 747:
The option "show_warnings" does not exist. Defined options are: "encoding", "error_severity",
"ignore_patterns", "report", "report_width", "severity", "sniffs", "standard", "tab_width",
"triggered_by", "warning_severity", "whitelist_patterns".

After reading about how GrumPHP utilizes Git hooks and how to configure Code_Sniffer to handle warnings, I managed to track back the source of the message which is probably sent by Symfony's OptionsResolver component.

But from this point I can't proceed further with figuring out how to make it properly working.

mhavelant commented 5 years ago

This package will not overwrite any existing grumphp.yml files. The old one has to be removed or renamed and this package has to be reinstalled. Note: Currently there should be around 8 checks configured, the copied CLI output shows 3. Note2: #2

balu-ertl commented 5 years ago

Thanks for pointing to the right direction. Indeed, now it works. Steps how I managed to install:

  1. An "_orig" postfix appended to the filename of the original (from EL project's master branch) grumphp.yml file (not deleted, kept there).
  2. wodby@php.container:/var/www/html $ composer require brainsum/drupal-dev-tools:'0.2.0' --dev
  3. I expected a new grumphp.yml to automatically appear beside the original one, but by some reason it did not happen. So I manually downloaded the grumphp.dist.yml from the repo and placed it there.
  4. Now the checks run properly:
    
    GrumPHP detected a pre-commit command.
    GrumPHP is sniffing your code!
    Running task 1/8: Composer... ✔
    Running task 2/8: BranchName... ✔
    Running task 3/8: Phpcs... ✔
    Running task 4/8: PhpLint... ✔
    Running task 5/8: PhpParser... ✔
    Running task 6/8: PhpVersion... ✔
    Running task 7/8: SecurityChecker... ✔
    Running task 8/8: YamlLint... ✔
    GrumPHP detected a commit-msg command.
    GrumPHP is sniffing your code!
    Running task 1/1: CommitMessage... ✘```