Skip to content
  • Bartek Jaskulski's avatar
    bc8464cc
    fix: don't interfere with stdout/stderr in linter · bc8464cc
    Bartek Jaskulski authored
    
    
    `php -l` is inconsistent in it's return codes, as it may exit 0 on
    correct code, but while encountering parse errors, it may end up with
    0 or 255, but the message is sent do `stdout` instead of `stderr`. This
    may seem irrelevant but have some serious implications.
    
    If we decide to ignore `stdout` (which is better for readable job trace),
    we may end up with error exit code but without error message, impossible
    to detect. On the other hand, if we send all `stderr` output to
    `/dev/null`, we consequently ignore most of errors produced by linter,
    thus we think our code is valid, which may not be true.
    
    To keep best of both worlds (succinct output and clear error messages)
    rely on filtering output, to contain only those lines, which may inform
    us about errors and ignore all "No syntax errors" lines as it may be the
    most predictable way.
    
    Signed-off-by: default avatarBart Jaskulski <bjaskulski@protonmail.com>
    bc8464cc
    fix: don't interfere with stdout/stderr in linter
    Bartek Jaskulski authored
    
    
    `php -l` is inconsistent in it's return codes, as it may exit 0 on
    correct code, but while encountering parse errors, it may end up with
    0 or 255, but the message is sent do `stdout` instead of `stderr`. This
    may seem irrelevant but have some serious implications.
    
    If we decide to ignore `stdout` (which is better for readable job trace),
    we may end up with error exit code but without error message, impossible
    to detect. On the other hand, if we send all `stderr` output to
    `/dev/null`, we consequently ignore most of errors produced by linter,
    thus we think our code is valid, which may not be true.
    
    To keep best of both worlds (succinct output and clear error messages)
    rely on filtering output, to contain only those lines, which may inform
    us about errors and ignore all "No syntax errors" lines as it may be the
    most predictable way.
    
    Signed-off-by: default avatarBart Jaskulski <bjaskulski@protonmail.com>
Loading