diff --git a/doc/exts/pylint_messages.py b/doc/exts/pylint_messages.py index 49021d3f4f..b16f7b0264 100644 --- a/doc/exts/pylint_messages.py +++ b/doc/exts/pylint_messages.py @@ -84,7 +84,7 @@ def _get_example_code(data_path: Path) -> str: ) _check_placeholders(data_path, bad_code, details, related) - return "\n".join((good_code, bad_code, pylintrc, details, related)) + "\n" + return "\n".join((bad_code, good_code, pylintrc, details, related)) + "\n" def _get_pylintrc_code(data_path: Path) -> str: @@ -307,7 +307,7 @@ def _generate_single_message_body(message: MessageData) -> str: {get_rst_title(f"{message.name} / {message.id}", "=")} **Message emitted:** -{message.definition.msg} +``{message.definition.msg}`` **Description:** diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py index c9bec38232..e46b5f5744 100644 --- a/pylint/checkers/stdlib.py +++ b/pylint/checkers/stdlib.py @@ -386,7 +386,7 @@ class StdlibChecker(DeprecatedMixin, BaseChecker): "By default, the first parameter is the group param, not the target param.", ), "W1507": ( - "Using copy.copy(os.environ). Use os.environ.copy() instead. ", + "Using copy.copy(os.environ). Use os.environ.copy() instead.", "shallow-copy-environ", "os.environ is not a dict object but proxy object, so " "shallow copy has still effects on original object. " diff --git a/tests/functional/s/shallow_copy_environ.txt b/tests/functional/s/shallow_copy_environ.txt index 73c2c9d27e..b7e37e2621 100644 --- a/tests/functional/s/shallow_copy_environ.txt +++ b/tests/functional/s/shallow_copy_environ.txt @@ -1,2 +1,2 @@ -shallow-copy-environ:7:0:7:21::Using copy.copy(os.environ). Use os.environ.copy() instead. :UNDEFINED -shallow-copy-environ:17:0:17:18::Using copy.copy(os.environ). Use os.environ.copy() instead. :UNDEFINED +shallow-copy-environ:7:0:7:21::Using copy.copy(os.environ). Use os.environ.copy() instead.:UNDEFINED +shallow-copy-environ:17:0:17:18::Using copy.copy(os.environ). Use os.environ.copy() instead.:UNDEFINED