Skip to content

Commit d042f72

Browse files
Add documentation for emitted messages (#7936)
* Add doc for import-error * Add doc for disallowed-name * Add doc for else-if-used * Add doc for import-self Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent c61bc76 commit d042f72

File tree

13 files changed

+31
-8
lines changed

13 files changed

+31
-8
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def foo(): # [disallowed-name]
2+
pass

doc/data/messages/d/disallowed-name/details.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
# This is a placeholder for correct code for this message.
1+
def something_meaningful():
2+
pass
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
if input():
2+
pass
3+
else:
4+
if len(input()) >= 10: # [else-if-used]
5+
pass
6+
else:
7+
pass

doc/data/messages/e/else-if-used/details.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
# This is a placeholder for correct code for this message.
1+
if input():
2+
pass
3+
elif len(input()) >= 10:
4+
pass
5+
else:
6+
pass
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[MAIN]
2+
load-plugins=pylint.extensions.check_elif
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from patlib import Path # [import-error]
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !
1+
This can happen if you're importing a package that is not installed in your environment, or if you made a typo.
2+
3+
The solution is to install the package via pip/setup.py/wheel or fix the typo.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# This is a placeholder for correct code for this message.
1+
from pathlib import Path

0 commit comments

Comments
 (0)