[Analyzer Comments]: Changes for Upgrade to Python 3.13#2392
[Analyzer Comments]: Changes for Upgrade to Python 3.13#2392BethanyG merged 7 commits intoexercism:mainfrom
Conversation
…Added general recommendations for exercises that have no comments from analyzer.
|
@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!! |
|
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"
}
]
} |
|
It appears as though it should work. But I have not worked with the analyzer much at all (can't even remember That said, there is nothing that is raising the hairs on the back of my |
Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com>
Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com>
Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com>
|
Hopefully, these are the last touches. 😄 |
|
I wonder if the mechanics of it knows how to use ERB for this. You want to get together later today or tomorrow to look at this together? But yes, for processing escapes you would use |
Sure - if we can simulate what the website is doing. I can also change what is returned in the JSON so that there aren't escapes. I just need to know how to format things to create a proper code fence in the output. |

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.