summaryrefslogtreecommitdiff
path: root/doc/data
diff options
context:
space:
mode:
authorHarutaka Kawamura <hkawamura0130@gmail.com>2022-06-05 18:25:27 +0900
committerGitHub <noreply@github.com>2022-06-05 11:25:27 +0200
commita2169c2d05586a6c2ed5fce71d2a71a5d4acf3cd (patch)
treecfacc1982491515cf5a2474fe97125c6d8765881 /doc/data
parentb421f311b5de84a734068bf1a83c92ca13bda215 (diff)
downloadpylint-git-a2169c2d05586a6c2ed5fce71d2a71a5d4acf3cd.tar.gz
[doc] Add `unnecessary-lambda` example (#6844)
Signed-off-by: harupy <hkawamura0130@gmail.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'doc/data')
-rw-r--r--doc/data/messages/u/unnecessary-lambda/bad.py5
-rw-r--r--doc/data/messages/u/unnecessary-lambda/details.rst1
-rw-r--r--doc/data/messages/u/unnecessary-lambda/good.py4
3 files changed, 8 insertions, 2 deletions
diff --git a/doc/data/messages/u/unnecessary-lambda/bad.py b/doc/data/messages/u/unnecessary-lambda/bad.py
new file mode 100644
index 000000000..ddf84f7fa
--- /dev/null
+++ b/doc/data/messages/u/unnecessary-lambda/bad.py
@@ -0,0 +1,5 @@
+function = lambda x: print(x) # [unnecessary-lambda]
+
+function("Hello world !")
+
+df.apply(lambda x: str(x)) # [unnecessary-lambda]
diff --git a/doc/data/messages/u/unnecessary-lambda/details.rst b/doc/data/messages/u/unnecessary-lambda/details.rst
deleted file mode 100644
index ab8204529..000000000
--- a/doc/data/messages/u/unnecessary-lambda/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/u/unnecessary-lambda/good.py b/doc/data/messages/u/unnecessary-lambda/good.py
index c40beb573..9f0678f02 100644
--- a/doc/data/messages/u/unnecessary-lambda/good.py
+++ b/doc/data/messages/u/unnecessary-lambda/good.py
@@ -1 +1,3 @@
-# This is a placeholder for correct code for this message.
+print("Hello world !")
+
+df.apply(str)