[refurb] Implement print-empty-string (FURB105) (#7617)

## Summary

Implement
[`simplify-print`](https://github.com/dosisod/refurb/blob/master/refurb/checks/builtin/print.py)
as `print-empty-string` (`FURB105`).

Extends the original rule in that it also checks for multiple empty
string positional arguments with an empty string separator.

Related to #1348.

## Test Plan

`cargo test`
This commit is contained in:
Tom Kuson 2023-09-24 05:10:36 +01:00 committed by GitHub
parent 865c89800e
commit 604cf521b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 535 additions and 0 deletions

View file

@ -0,0 +1,32 @@
# Errors.
print("")
print("", sep=",")
print("", end="bar")
print("", sep=",", end="bar")
print(sep="")
print("", sep="")
print("", "", sep="")
print("", "", sep="", end="")
print("", "", sep="", end="bar")
print("", sep="", end="bar")
print(sep="", end="bar")
print("", "foo", sep="")
print("foo", "", sep="")
print("foo", "", "bar", sep="")
print("", *args)
print("", *args, sep="")
# OK.
print()
print("foo")
print("", "")
print("", "foo")
print("foo", "")
print("", "", sep=",")
print("", "foo", sep=",")
print("foo", "", sep=",")
print("foo", "", "bar", "", sep=",")
print("", "", **kwargs)
print("", **kwargs)