summaryrefslogtreecommitdiff
path: root/doc/data/messages/n
diff options
context:
space:
mode:
Diffstat (limited to 'doc/data/messages/n')
-rw-r--r--doc/data/messages/n/non-str-assignment-to-dunder-name/bad.py5
-rw-r--r--doc/data/messages/n/non-str-assignment-to-dunder-name/details.rst1
-rw-r--r--doc/data/messages/n/non-str-assignment-to-dunder-name/good.py6
-rw-r--r--doc/data/messages/n/nonlocal-without-binding/bad.py3
-rw-r--r--doc/data/messages/n/nonlocal-without-binding/details.rst1
-rw-r--r--doc/data/messages/n/nonlocal-without-binding/good.py6
-rw-r--r--doc/data/messages/n/not-a-mapping/bad.py5
-rw-r--r--doc/data/messages/n/not-a-mapping/details.rst1
-rw-r--r--doc/data/messages/n/not-a-mapping/good.py6
9 files changed, 28 insertions, 6 deletions
diff --git a/doc/data/messages/n/non-str-assignment-to-dunder-name/bad.py b/doc/data/messages/n/non-str-assignment-to-dunder-name/bad.py
new file mode 100644
index 000000000..59f13a13c
--- /dev/null
+++ b/doc/data/messages/n/non-str-assignment-to-dunder-name/bad.py
@@ -0,0 +1,5 @@
+class Fruit:
+ pass
+
+
+Fruit.__name__ = 1 # [non-str-assignment-to-dunder-name]
diff --git a/doc/data/messages/n/non-str-assignment-to-dunder-name/details.rst b/doc/data/messages/n/non-str-assignment-to-dunder-name/details.rst
deleted file mode 100644
index ab8204529..000000000
--- a/doc/data/messages/n/non-str-assignment-to-dunder-name/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/n/non-str-assignment-to-dunder-name/good.py b/doc/data/messages/n/non-str-assignment-to-dunder-name/good.py
index c40beb573..ff55f1800 100644
--- a/doc/data/messages/n/non-str-assignment-to-dunder-name/good.py
+++ b/doc/data/messages/n/non-str-assignment-to-dunder-name/good.py
@@ -1 +1,5 @@
-# This is a placeholder for correct code for this message.
+class Fruit:
+ pass
+
+
+Fruit.__name__ = "FRUIT"
diff --git a/doc/data/messages/n/nonlocal-without-binding/bad.py b/doc/data/messages/n/nonlocal-without-binding/bad.py
new file mode 100644
index 000000000..6a166e09f
--- /dev/null
+++ b/doc/data/messages/n/nonlocal-without-binding/bad.py
@@ -0,0 +1,3 @@
+class Fruit:
+ def get_color(self):
+ nonlocal colors # [nonlocal-without-binding]
diff --git a/doc/data/messages/n/nonlocal-without-binding/details.rst b/doc/data/messages/n/nonlocal-without-binding/details.rst
deleted file mode 100644
index ab8204529..000000000
--- a/doc/data/messages/n/nonlocal-without-binding/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/n/nonlocal-without-binding/good.py b/doc/data/messages/n/nonlocal-without-binding/good.py
index c40beb573..cce884ac8 100644
--- a/doc/data/messages/n/nonlocal-without-binding/good.py
+++ b/doc/data/messages/n/nonlocal-without-binding/good.py
@@ -1 +1,5 @@
-# This is a placeholder for correct code for this message.
+class Fruit:
+ colors = ["red", "green"]
+
+ def get_color(self):
+ nonlocal colors
diff --git a/doc/data/messages/n/not-a-mapping/bad.py b/doc/data/messages/n/not-a-mapping/bad.py
new file mode 100644
index 000000000..79ca9215e
--- /dev/null
+++ b/doc/data/messages/n/not-a-mapping/bad.py
@@ -0,0 +1,5 @@
+def print_colors(**colors):
+ print(colors)
+
+
+print_colors(**list("red", "black")) # [not-a-mapping]
diff --git a/doc/data/messages/n/not-a-mapping/details.rst b/doc/data/messages/n/not-a-mapping/details.rst
deleted file mode 100644
index ab8204529..000000000
--- a/doc/data/messages/n/not-a-mapping/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/n/not-a-mapping/good.py b/doc/data/messages/n/not-a-mapping/good.py
index c40beb573..3de53ac5d 100644
--- a/doc/data/messages/n/not-a-mapping/good.py
+++ b/doc/data/messages/n/not-a-mapping/good.py
@@ -1 +1,5 @@
-# This is a placeholder for correct code for this message.
+def print_colors(**colors):
+ print(colors)
+
+
+print_colors(**dict(red=1, black=2))