Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add example for missing-format-argument-key message documentation #6115

Merged
merged 2 commits into from
Apr 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/data/messages/m/missing-format-argument-key/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("My name is {first} {last}".format(first="John")) # [missing-format-argument-key]
1 change: 1 addition & 0 deletions doc/data/messages/m/missing-format-argument-key/good.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("My name is {first} {last}".format(first="John", last="Wick"))
2 changes: 2 additions & 0 deletions doc/data/messages/m/missing-format-argument-key/related.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`PEP 3101 <https://peps.python.org/pep-3101/>`_
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pierre-Sassoulas @gunungpw I didn't check this myself, but the related.rst documents should preferably be a list using - .... That gets formatted a little nicer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an issue with lists in something we merged recently see additional detail : https://pylint.pycqa.org/en/latest/messages/warning/arguments-differ.html. I think because it's rst formatting we need * instead of -.

`Custom String Formmating <https://docs.python.org/3/library/string.html#custom-string-formatting>`_