Skip to content

Refactor string concatenation to use f-strings for improved code quality #4

@sourcery-ai

Description

@sourcery-ai

In the codebase, there are instances where string concatenation is used to construct strings, such as:

return masked + '@' + dom

It is recommended to use f-strings for better readability and performance. For example, the above can be refactored to:

return f"{masked}@{dom}"

Action Items:

  • Search for occurrences of string concatenation used for building strings, especially with variables and literals.
  • Refactor these instances to use f-strings instead.
  • Ensure all tests pass after the refactor.

Reference: Sourcery Rule: use-fstring-for-concatenation


I created this issue for @uditmanav17 from #3 (comment).

Tips and commands

Getting Help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions