Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/data/messages/c/compare-to-empty-string/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
x = ""
y = "hello"

if x == "": # [compare-to-empty-string]
print("x is an empty string")

if y != "": # [compare-to-empty-string]
print("y is not an empty string")
1 change: 0 additions & 1 deletion doc/data/messages/c/compare-to-empty-string/details.rst

This file was deleted.

9 changes: 8 additions & 1 deletion doc/data/messages/c/compare-to-empty-string/good.py
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
# This is a placeholder for correct code for this message.
x = ""
y = "hello"

if not x:
print("x is an empty string")

if y:
print("y is not an empty string")
2 changes: 2 additions & 0 deletions doc/data/messages/c/compare-to-empty-string/pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[main]
load-plugins=pylint.extensions.emptystring