diff options
7 files changed, 13 insertions, 4 deletions
diff --git a/doc/data/messages/c/consider-ternary-expression/bad.py b/doc/data/messages/c/consider-ternary-expression/bad.py new file mode 100644 index 000000000..741784481 --- /dev/null +++ b/doc/data/messages/c/consider-ternary-expression/bad.py @@ -0,0 +1,5 @@ +x, y = input(), input()
+if x >= y: # [consider-ternary-expression]
+ maximum = x
+else:
+ maximum = y
diff --git a/doc/data/messages/c/consider-ternary-expression/details.rst b/doc/data/messages/c/consider-ternary-expression/details.rst deleted file mode 100644 index ab8204529..000000000 --- a/doc/data/messages/c/consider-ternary-expression/details.rst +++ /dev/null @@ -1 +0,0 @@ -You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ ! diff --git a/doc/data/messages/c/consider-ternary-expression/good.py b/doc/data/messages/c/consider-ternary-expression/good.py index c40beb573..117324054 100644 --- a/doc/data/messages/c/consider-ternary-expression/good.py +++ b/doc/data/messages/c/consider-ternary-expression/good.py @@ -1 +1,2 @@ -# This is a placeholder for correct code for this message. +x, y = input(), input() +maximum = x if x >= y else y diff --git a/doc/data/messages/c/consider-ternary-expression/pylintrc b/doc/data/messages/c/consider-ternary-expression/pylintrc new file mode 100644 index 000000000..814b5ece4 --- /dev/null +++ b/doc/data/messages/c/consider-ternary-expression/pylintrc @@ -0,0 +1,2 @@ +[MAIN]
+load-plugins=pylint.extensions.consider_ternary_expression
diff --git a/doc/data/messages/c/consider-using-ternary/bad.py b/doc/data/messages/c/consider-using-ternary/bad.py new file mode 100644 index 000000000..39a790f86 --- /dev/null +++ b/doc/data/messages/c/consider-using-ternary/bad.py @@ -0,0 +1,2 @@ +x, y = 1, 2
+maximum = x >= y and x or y # [consider-using-ternary]
diff --git a/doc/data/messages/c/consider-using-ternary/details.rst b/doc/data/messages/c/consider-using-ternary/details.rst deleted file mode 100644 index ab8204529..000000000 --- a/doc/data/messages/c/consider-using-ternary/details.rst +++ /dev/null @@ -1 +0,0 @@ -You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ ! diff --git a/doc/data/messages/c/consider-using-ternary/good.py b/doc/data/messages/c/consider-using-ternary/good.py index c40beb573..bcb8446bc 100644 --- a/doc/data/messages/c/consider-using-ternary/good.py +++ b/doc/data/messages/c/consider-using-ternary/good.py @@ -1 +1,2 @@ -# This is a placeholder for correct code for this message. +x, y = 1, 2 +maximum = x if x >= y else y |