Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipe error messages to stderr #154

Closed
ievans opened this issue Feb 13, 2020 · 1 comment
Closed

pipe error messages to stderr #154

ievans opened this issue Feb 13, 2020 · 1 comment
Assignees

Comments

@ievans
Copy link
Member

ievans commented Feb 13, 2020

sgrep-core should pipe output to stderr especially when outputting json/r2c mode, these issues should be collected under the errors key

using latest sgrep-lint with the --config=r2c option on

git clone https://github.com/yaml/pyyaml /tmp/pyyaml && cd /tmp/pyyaml && git checkout 5986257f9fc978d4a61b6e0001df554f80e565cb && cd -

The following is output to stdout, but it should really go to stderr:

PB: Ast_c_build, on /analysis/inputs/public/source-code/ext/_yaml.h (exn = (Failure "/analysis/inputs/public/source-code/ext/_yaml.h:23:0: no ifdef"))

Full reference, see failure at https://dev.massive.ret2.co/jobs/544?page=1&sort_on=repo_url&sort_by=asc

@aryx
Copy link
Collaborator

aryx commented Feb 19, 2020

I can't reproduce either, or maybe I misunderstood.
But for me the error does go on stderr.

$ yy -lang c -e 'XXXXX' -r2c .

  • /home/pad/github/sgrep/_build/default/bin/main_sgrep.exe -lang c -e XXXXX -r2c .
    (ONCE) skipping: #if PY_MAJOR_VERSION < 3

(ONCE) skipping: #ifdef _MSC_VER
PB: Ast_c_build, on /tmp/pyyaml/ext/_yaml.h (exn = (Failure "/tmp/pyyaml/ext/_yaml.h:23:0: no ifdef"))
{ "results": [] }
pad@yrax:/tmp/pyyaml$ yy -lang c -e 'XXXXX' -r2c . > /tmp/res

  • /home/pad/github/sgrep/_build/default/bin/main_sgrep.exe -lang c -e XXXXX -r2c .
    (ONCE) skipping: #if PY_MAJOR_VERSION < 3

(ONCE) skipping: #ifdef _MSC_VER
PB: Ast_c_build, on /tmp/pyyaml/ext/_yaml.h (exn = (Failure "/tmp/pyyaml/ext/_yaml.h:23:0: no ifdef"))
pad@yrax:/tmp/pyyaml$ cat /tmp/res
{ "results": [] }

@aryx aryx closed this as completed Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants