Skip to content

PHP CS Fixer levels should be in lowercase and php-cs-fixer errors are not detected #94

@xocasdashdash

Description

@xocasdashdash

In the following lines: https://github.com/bruli/php-git-hooks/blob/master/src/PhpGitHooks/Module/PhpCsFixer/Service/PhpCsFixerTool.php#L45-L59

The php-cs-fixer levels are defined in uppercase, but php-cs-fixer fails if it uses that configuration if you run this locally:
'bin/php-cs-fixer' '--dry-run' 'fix' 'src/Cueball/PixelBundle/Controller/alpha/PixelController.php' '--level=SYMFONY'
The command fails, but the failure is not detected because on https://github.com/bruli/php-git-hooks/blob/master/src/PhpGitHooks/Module/PhpCsFixer/Infrastructure/Tool/PhpCsFixerToolProcessor.php#L79 you use the normal output and the php-cs-fixer process writes to the error output (if you change the method to use getErrorOutput you start seeing the errors)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions