[Analyzer Comments]: Changes for Upgrade to Python 3.13#2392
Open
BethanyG wants to merge 1 commit intoexercism:mainfrom
Open
[Analyzer Comments]: Changes for Upgrade to Python 3.13#2392BethanyG wants to merge 1 commit intoexercism:mainfrom
BethanyG wants to merge 1 commit intoexercism:mainfrom
Conversation
…Added general recommendations for exercises that have no comments from analyzer.
Member
Author
|
@kotp - need feedback on the Ruby string interpolation for the PyLint comments. I did try them out on https://try.ruby-lang.org/, but not completely sure that they'll work with Exercism's processing. I want to avoid having to PR all of the code examples here, which is why I am shoving them into JSON and then trying to expand them in the feedback doc. Please let me know if you need to see a sample @IsaacG - I think we can safely do 10 recommendations in
Many thanks to you both for reviewing!! |
Member
Author
|
Decided I should just put in a sample {
"summary": "There are a few changes we'd like you to make before completing this exercise.",
"comments": [
{
"comment": "python.pylint.warning",
"params": {
"lineno": "46",
"code": "W0622 redefined-builtin",
"message": "Redefining built-in 'sum'",
"bad_code": "def map(): # [redefined-builtin]\n pass\n",
"good_code": "def map_iterable():\n pass\n",
"related_info": null,
"details": "Shadowing [built-ins](https://docs.python.org/3.13/library/functions.html) at the global scope is discouraged because it\nobscures their behavior throughout the entire module, increasing the\nrisk of subtle bugs when the built-in is needed elsewhere.\n\n In contrast, local redefinitions _might_ be acceptable as their impact is confined to a\nspecific scope; although it is generally not a good idea.\n"
},
"type": "essential"
},
{
"comment": "python.pylint.error",
"params": {
"lineno": "46",
"code": "E0601 used-before-assignment",
"message": "Using variable 'sum' before assignment",
"bad_code": "print(hello) # [used-before-assignment]\nhello = \"Hello World !\"\n",
"good_code": "hello = \"Hello World !\"\nprint(hello)\n",
"related_info": null,
"details": null
},
"type": "essential"
},
{
"comment": "python.pylint.refactor",
"params": {
"lineno": "62",
"code": "R1705 no-else-return",
"message": "Unnecessary \"elif\" after \"return\", remove the leading \"el\" from \"elif",
"bad_code": "def compare_numbers(a: int, b: int) -> int:\n if a == b: # [no-else-return]\n return 0\n elif a < b:\n return -1\n else:\n return 1\n",
"good_code": "def compare_numbers(a: int, b: int) -> int:\n if a == b:\n return 0\n if a < b:\n return -1\n return 1\n",
"related_info": "- [Unnecessary-else-statements](https://www.pythonmorsels.com/unnecessary-else-statements/)\n",
"details": null
},
"type": "actionable"
}
]
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
analyzer-comments/python/pylint/convention.mdto (hopefully) accommodate additional code examples and comments from PyLint.analyzer-comments/python/pylint/refactor.mdto (hopefully) accommodate additional code examples and comments from PyLint.