Skip to content

Commit 7d3c34c

Browse files
[doc] Add an example for 'non-ascii-file-name'
And move links to related.rst
1 parent 8bf1120 commit 7d3c34c

File tree

9 files changed

+12
-16
lines changed

9 files changed

+12
-16
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# [non-ascii-file-name]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# [non-ascii-file-name]

doc/data/messages/n/non-ascii-file-name/details.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/data/messages/n/non-ascii-file-name/good.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/data/messages/n/non-ascii-file-name/good/bad.py

Whitespace-only changes.

doc/data/messages/n/non-ascii-file-name/good/not_better.py

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- `PEP 489 <https://peps.python.org/pep-0489/#export-hook-name>`_
2+
- `PEP 672 <https://peps.python.org/pep-0672/#confusing-features>`_
3+
- `Python issue 20485 <https://bugs.python.org/issue20485>`_

pylint/checkers/non_ascii_names.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,15 @@ class NonAsciiNameChecker(base_checker.BaseChecker):
4343
),
4444
# First %s will always be "file"
4545
"W2402": (
46-
(
47-
'%s name "%s" contains a non-ASCII character. PEP 3131 only allows '
48-
"non-ascii identifiers, not file names."
49-
),
46+
'%s name "%s" contains a non-ASCII character.',
5047
"non-ascii-file-name",
5148
(
5249
# Some = PyCharm at the time of writing didn't display the non_ascii_name_loł
53-
# files and had big troubles with git.
54-
# Probably only a bug shows the problem quite good.
55-
# That's also why this is a warning and not only a convention!
56-
"Some editors don't support non-ASCII file names properly. "
57-
"Even though Python supports UTF-8 files since Python 3.5 this isn't "
58-
"recommended for interoperability. Further reading:\n"
59-
"- https://peps.python.org/pep-0489/#export-hook-name\n"
60-
"- https://peps.python.org/pep-0672/#confusing-features\n"
61-
"- https://bugs.python.org/issue20485"
50+
# files and had big troubles with git. Probably only a bug shows the problem
51+
# quite good. That's also why this is a warning and not only a convention!
52+
"Under python 3.5, PEP 3131 only allows non-ascii identifiers, not file names."
53+
"Since Python 3.5, even though Python supports UTF-8 files, some editors or tools "
54+
"don't. "
6255
),
6356
),
6457
# First %s will always be "module"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
non-ascii-file-name:1:0:None:None::"File name ""non_ascii_name_loł"" contains a non-ASCII character. PEP 3131 only allows non-ascii identifiers, not file names.":HIGH
1+
non-ascii-file-name:1:0:None:None::"File name ""non_ascii_name_loł"" contains a non-ASCII character.":HIGH

0 commit comments

Comments
 (0)