Deno: Deno 1.4.0 fmt --quiet option regression

Created on 14 Sep 2020  路  8Comments  路  Source: denoland/deno

The quiet option is not honoured:

$ deno --version
deno 1.3.3
v8 8.6.334
typescript 4.0.2

$ deno fmt --quiet Drakefile.ts 

$
$ deno --version
deno 1.4.0
v8 8.7.75
typescript 4.0.2

$ deno fmt --quiet Drakefile.ts 
Checked 1 file

$

The Checked N file message appears to be new (fmt was quiet by default in Deno 1.3.3).

bug cli

Most helpful comment

Thanks for the report. I forgot to consider quiet flag when implementing that feature. I will fix it shortly.

All 8 comments

Yeah this was initially behind a verbose flag, the flag was dropped and we're here.

Thanks for the report. I forgot to consider quiet flag when implementing that feature. I will fix it shortly.

Seems that outputs of subcommands have been going to _stdout_ since https://github.com/denoland/deno/pull/7142, so the description of quiet option is actually wrong now.

    -q, --quiet
            Suppress diagnostic output
            By default, subcommands print human-readable diagnostic messages to stderr.
            If the flag is set, restrict these messages to errors.

It would be nice to revert it so that logger output will go to _stderr_.

@magurotuna seems like an unintended change, could you fix that in the same PR?

@bartlomieju Yes, of course.
Additionally, I'm planning to make the integration tests check stdout/stderr separately. That said, currently the integration tests are checking outputs with stdout and stderr together. I will change it, so actual _stdout_ will be compared with expected _stdout_, and actual _stderr_ with expected _stderr_.
It would help us make sure that outputs are printed to correct (expected) places.

Seems that outputs of subcommands have been going to stdout since #7142

my bad, this is wrong. The outputs of subcommands indeed go to _stderr_, as they did before. (I missed env_logger document where we can see the default target is _stderr_.)
But nevertheless I think it should be nice that stdout and stderr are tested separately, so I'll keep implementing it.
And then, I will use the logger functions instead of println! and eprintln! in fmt and lint. It will allow us not to take care of quiet flag in each subcommand implementation.

But nevertheless I think it should be nice that stdout and stderr are tested separately, so I'll keep implementing it.
And then, I will use the logger functions instead of println! and eprintln! in fmt and lint. It will allow us not to take care of quiet flag in each subcommand implementation.

@magurotuna sounds good, let's start with fixing --quiet regression - I don't think there's a lot of need to have stdout/stderr tested separately in itest! - in such cases we just write test case by hand, eg. run_watch.

@bartlomieju
okay, I'll fix the quiet regression first.

I don't think there's a lot of need to have stdout/stderr tested separately in itest! - in such cases we just write test case by hand, eg. run_watch.

To be honest I have about 70% finished implementing the feature, so I'd like to open a PR when completing it. And at that time if you and other people think of it as unnecessary, feel free to close it without merging :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kyeotic picture kyeotic  路  3Comments

benjamingr picture benjamingr  路  3Comments

CruxCv picture CruxCv  路  3Comments

ry picture ry  路  3Comments

doutchnugget picture doutchnugget  路  3Comments