Skip to main content

Removes commented-out code.

Project description

Build status

eradicate removes commented-out code from Python files.


With modern revision control available, there is no reason to save commented-out code to your repository. eradicate helps cleans up existing junk comments. It does this by detecting block comments that contain valid Python syntax that are likely to be commented out code. (It avoids false positives like the sentence this is not good, which is valid Python syntax, but is probably not code.)


$ eradicate --in-place

Before running eradicate.

#import os
# from foo import junk
#a = 3
a = 4
#foo(1, 2, 3)

def foo(x, y, z):
    # print('hello')
    print(x, y, z)

    # This is a real comment.
    #return True
    return False

After running eradicate.

a = 4

def foo(x, y, z):
    print(x, y, z)

    # This is a real comment.
    return False

Project details

Download files

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

Files for eradicate, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size eradicate-1.0.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page