diff --git a/src/core_codemods/docs/pixee_python_remove-unnecessary-f-str.md b/src/core_codemods/docs/pixee_python_remove-unnecessary-f-str.md index 659ed971..aacc1eae 100644 --- a/src/core_codemods/docs/pixee_python_remove-unnecessary-f-str.md +++ b/src/core_codemods/docs/pixee_python_remove-unnecessary-f-str.md @@ -1,4 +1,9 @@ -This codemod converts any f-strings without interpolation to regular strings. +This codemod converts any f-strings without interpolated variables into regular strings. +In these cases the use of f-string is not necessary; a simple string literal is sufficient. + +While in some (extreme) cases we might expect a very modest performance +improvement, in general this is a fix that improves the overall cleanliness and +quality of your code. ```diff - var = f"hello" diff --git a/src/core_codemods/remove_unnecessary_f_str.py b/src/core_codemods/remove_unnecessary_f_str.py index d45d3f04..c07e8246 100644 --- a/src/core_codemods/remove_unnecessary_f_str.py +++ b/src/core_codemods/remove_unnecessary_f_str.py @@ -14,10 +14,14 @@ class RemoveUnnecessaryFStr(BaseCodemod, UnnecessaryFormatString): SUMMARY = "Remove Unnecessary F-strings" DESCRIPTION = UnnecessaryFormatString.DESCRIPTION REFERENCES = [ + { + "url": "https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/f-string-without-interpolation.html", + "description": "", + }, { "url": "https://github.com/Instagram/LibCST/blob/main/libcst/codemod/commands/unnecessary_format_string.py", "description": "", - } + }, ] def __init__(self, codemod_context: CodemodContext, *codemod_args):