Skip to content

Invalid JSON output #274

@mxr576

Description

@mxr576

How is drupal-check installed?
drupal-check is installed as a dependency to my project

Environment:

  • OS: Linux (Docker containers by Wodby)
  • PHP Version: 7.4
  • Drupal core: 9.2.x

Describe the bug

./vendor/bin/drupal-check --format=json returns an invalid JSON since 1.3.0. 62dfa4d and that has not been fixed in 900d859 either. Why? Because in some runtime environments, like Docker containers, stderr and stdout is redirected to the same destination, /proc/self/fd/2.

php -i | grep error_log
error_log => /proc/self/fd/2 => /proc/self/fd/2

Suggested solution
If this information truly needed to be added to the output in every possible output formats then the added message must respect the expected output format.

Console output

./vendor/bin/drupal-check web
/modules/custom/ --format=json --no-progress
{
    "totals": {
        "errors": 0,
        "file_errors": 0
    },
    "files": [],
    "errors": []
}Thanks for using drupal-check!

Consider sponsoring the development of the maintainers which make drupal-check possible:

- phpstan (ondrejmirtes): https://github.com/sponsors/ondrejmirtes
- phpstan-deprecation-rules (ondrejmirtes)): https://github.com/sponsors/ondrejmirtes
- phpstan-drupal (mglaman)): https://github.com/sponsors/mglaman
- drupal-check (mglaman)): https://github.com/sponsors/mglaman

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