Skip to main content

Find and replace unneeded f-strings in your code.

Project description

rm_unneeded_f_str

Find and replace unneeded f-strings in your code.

Installation

pip install rm_unneeded_f_str

Usage

Run via the CLI on a file or folder:

  • rm-unneeded-f-str path/to/file.py
  • rm-unneeded-f-str path/to/folder/

Or use as a pre-commit hook:

-   repo: https://github.com/dannysepler/rm_unneeded_f_str
    rev: v0.2.0
    hooks:
    -   id: rm-unneeded-f-str

Will replace

-f'hello'
+'hello'
-f'''hello'''
+'''hello'''
-rf'hello'
+r'hello'
-f'''hello
-world'''
+f'''hello
+world'''

Will not replace

f'hello {world}'
f'''hello
{world}'''

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rm_unneeded_f_str-0.2.0.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

rm_unneeded_f_str-0.2.0-py2.py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page