Skip to content

Suppress congrats message #110

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

Closed
dahankzter opened this issue Jun 15, 2018 · 10 comments · Fixed by #112
Closed

Suppress congrats message #110

dahankzter opened this issue Jun 15, 2018 · 10 comments · Fixed by #112
Labels
enhancement New feature or improvement

Comments

@dahankzter
Copy link
Contributor

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

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

@jirfag
Copy link
Contributor

jirfag commented Jun 15, 2018

Hi,
What’s the use-case? How it can help you?

@jirfag jirfag added enhancement New feature or improvement no decision No decision to fix or not labels Jun 15, 2018
@dahankzter
Copy link
Contributor Author

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.

@dahankzter
Copy link
Contributor Author

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

@mmatczuk
Copy link

mmatczuk commented Jun 15, 2018

@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.

@jirfag
Copy link
Contributor

jirfag commented Jun 15, 2018

@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.

@jirfag jirfag removed the no decision No decision to fix or not label Jun 15, 2018
@mmatczuk
Copy link

Thanks @jirfag, congrats on this awesome tool!

@dahankzter
Copy link
Contributor Author

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

dahankzter added a commit to dahankzter/golangci-lint that referenced this issue Jun 15, 2018
There is now an extra switch '-s' to disable the congrats message when
there are no issues detected

Fixes: golangci#110
@dahankzter
Copy link
Contributor Author

I submitted some code for this @jirfag

dahankzter added a commit to dahankzter/golangci-lint that referenced this issue Jun 16, 2018
There is now an extra switch '-s' to disable the congrats message when
there are no issues detected

Fixes: golangci#110
dahankzter added a commit to dahankzter/golangci-lint that referenced this issue Jun 16, 2018
There is now an extra switch '-s' to disable the congrats message when
there are no issues detected

Fixes: golangci#110
@arp242
Copy link

arp242 commented Jun 16, 2018

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.

dahankzter added a commit to dahankzter/golangci-lint that referenced this issue Jun 16, 2018
There is now an extra switch '-s' to disable the congrats message when
there are no issues detected

Fixes: golangci#110
dahankzter added a commit to dahankzter/golangci-lint that referenced this issue Jun 16, 2018
There is now an extra switch '-s' to disable the congrats message when
there are no issues detected

Fixes: golangci#110
jirfag pushed a commit that referenced this issue Jun 16, 2018
There is now an extra switch '-s' to disable the congrats message when
there are no issues detected

Fixes: #110
@CamilleScholtz
Copy link

CamilleScholtz commented Jun 17, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants