Golangci-lint: Suppress congrats message

Created on 15 Jun 2018  路  10Comments  路  Source: golangci/golangci-lint

It would be nice to be able to suppress the congrats message: Congrats! No issues were found

Perhaps a flag: --no-congrats or something?

enhancement

Most helpful comment

@jirfag this breaks Unix Rule of Silence [1], which states that programs should, by default, say nothing.

[1] http://www.linfo.org/rule_of_silence.html
[2] http://www.linfo.org/unix_philosophy.html

ps.

Probably the same is true for json

$ golangci-lint run --out-format json ./...
{"Issues":[]} 

does not seem very helpful.

All 10 comments

Hi,
What鈥檚 the use-case? How it can help you?

The use case is simply to reduce noise. Our integration servers runs a lot of stuff and having to scroll through "positives" to find any errors just adds some overhead. Not much but it adds up from all the tools we use.

I can implement it if you think it would be a good addition.

@jirfag this breaks Unix Rule of Silence [1], which states that programs should, by default, say nothing.

[1] http://www.linfo.org/rule_of_silence.html
[2] http://www.linfo.org/unix_philosophy.html

ps.

Probably the same is true for json

$ golangci-lint run --out-format json ./...
{"Issues":[]} 

does not seem very helpful.

@dahankzter it will be great if you will implement it.
@mmatczuk ok, thank you, I agree, except json: no json is not valid json, but {} is valid.

Thanks @jirfag, congrats on this awesome tool!

Indeed an awesome tool! Ill get back with a PR asap.

I submitted some code for this @jirfag

I agree that the human-readable output should follow the "rule of silcence" whenever feasible @mmatczuk , but I'm not sure about the JSON:

Probably the same is true for json

$ golangci-lint run --out-format json ./...
{"Issues":[]}

does not seem very helpful.

An empty string can't be parsed by most (all?) JSON parsers, so people implementing this need to add an extra if output == "" check (and even if it would be parsable, you'd still need to check for the existence for the Issues key). So outputting that JSON is actually helpful here.

The "rule of silence" is for user interfaces, but the JSON output isn't a user interface but a programming API to integrate the tool with editors etc. I don't think that having it follow the same rules make sense.

I personally think that -s should be the default. The UNIX philosophy to check if a command was successful is to check the status ($?) variable on success and not print any output (this is why the go commands print nothing unless you pass some verbose flag)

The UNIX philosophy calls this "the rule of silence":

Developers should design programs so that they do not print unnecessary output. This rule aims to allow other programs and developers to pick out the information they need from a program's output without having to parse verbosity.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bacongobbler picture bacongobbler  路  4Comments

rhcarvalho picture rhcarvalho  路  4Comments

anuaimi picture anuaimi  路  4Comments

lnshi picture lnshi  路  4Comments

simonpasquier picture simonpasquier  路  4Comments