{"id":18468771,"url":"https://github.com/pycqa/eradicate","last_synced_at":"2025-12-12T01:01:54.127Z","repository":{"id":6066012,"uuid":"7291811","full_name":"PyCQA/eradicate","owner":"PyCQA","description":"Removes commented-out code from Python files","archived":false,"fork":false,"pushed_at":"2024-04-22T21:33:15.000Z","size":122,"stargazers_count":209,"open_issues_count":7,"forks_count":24,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-04T09:12:58.314Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/eradicate","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PyCQA.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-12-23T04:39:48.000Z","updated_at":"2025-03-02T11:09:56.000Z","dependencies_parsed_at":"2023-08-09T04:37:45.960Z","dependency_job_id":"74842700-ba08-45c5-a9b3-c7eb99135acd","html_url":"https://github.com/PyCQA/eradicate","commit_stats":{"total_commits":181,"total_committers":14,"mean_commits":"12.928571428571429","dds":"0.15469613259668513","last_synced_commit":"771fa7a33f0e72133113602fa58481f377403702"},"previous_names":["pycqa/eradicate","myint/eradicate","wemake-services/eradicate"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyCQA%2Feradicate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyCQA%2Feradicate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyCQA%2Feradicate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyCQA%2Feradicate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PyCQA","download_url":"https://codeload.github.com/PyCQA/eradicate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713258,"owners_count":20983683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T10:08:07.775Z","updated_at":"2025-12-12T01:01:50.047Z","avatar_url":"https://github.com/PyCQA.png","language":"Python","readme":"=========\neradicate\n=========\n\n.. image:: https://github.com/myint/eradicate/actions/workflows/test.yml/badge.svg\n    :target: https://github.com/myint/eradicate/actions/workflows/test.yml\n    :alt: Build status\n\n----\n\n``eradicate`` removes commented-out code from Python files.\n\n\nIntroduction\n============\n\nWith modern revision control available, there is no reason to save\ncommented-out code to your repository. ``eradicate`` helps cleans up\nexisting junk comments. It does this by detecting block comments that\ncontain valid Python syntax that are likely to be commented out code.\n(It avoids false positives like the sentence ``this is not good``,\nwhich is valid Python syntax, but is probably not code.)\n\n\nExample\n=======\n\n.. code-block:: bash\n\n    $ eradicate --in-place example.py\n\nBefore running ``eradicate``.\n\n.. code-block:: python\n\n    #import os\n    # from foo import junk\n    #a = 3\n    a = 4\n    #foo(1, 2, 3)\n\n    def foo(x, y, z):\n        # print('hello')\n        print(x, y, z)\n\n        # This is a real comment.\n        #return True\n        return False\n\nAfter running ``eradicate``.\n\n.. code-block:: python\n\n    a = 4\n\n    def foo(x, y, z):\n        print(x, y, z)\n\n        # This is a real comment.\n        return False\n\n\nWhitelisting\n============\n\nFalse positives can happen so there is a whitelist feature to fix them shorthand.\nYou can either add entries to the default whitelist with ``--whitelist-extend`` or overwrite the default with ``--whitelist``.\nBoth arguments expect a string of ``#`` separated regex strings (whitespaces are preserved). E.g. ``eradicate --whitelist \"foo#b a r\" filename``\nThose regex strings are matched case insensitive against the start of the comment itself.\n\nFor the default whitelist please see ``eradicate.py``.\n\n\nRelated\n=======\n\nThere are different tools, plugins, and integrations for ``eradicate`` users:\n\n- `flake8-eradicate \u003chttps://github.com/sobolevn/flake8-eradicate\u003e`_ - Flake8 plugin to find commented out or dead code.\n- `databricks-labs-pylint \u003chttps://github.com/databrickslabs/pylint-plugin#eradicate-checker\u003e`_ - Databricks-specific PyLint plugin, that can also find commented out code.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycqa%2Feradicate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpycqa%2Feradicate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpycqa%2Feradicate/lists"}