Skip to main content

Removes commented-out code.

Project description

Build status

eradicate removes commented-out code from Python files.

Introduction

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.)

Example

$ eradicate --in-place example.py

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.

Source Distribution

eradicate-1.0.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file eradicate-1.0.tar.gz.

File metadata

  • Download URL: eradicate-1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.4.1 requests/2.18.4 setuptools/32.3.1 requests-toolbelt/0.7.0 clint/0.5.1 CPython/3.6.7 Darwin/16.7.0

File hashes

Hashes for eradicate-1.0.tar.gz
Algorithm Hash digest
SHA256 4ffda82aae6fd49dfffa777a857cb758d77502a1f2e0f54c9ac5155a39d2d01a
MD5 8a5f643c9054285123b3809844fbcea2
BLAKE2b-256 65ed5b4506e122114f9439482d2a810ade4aa06cc4e306185931889e58b47f46

See more details on using hashes here.

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