Skip to main content

Remove commented code from projects automatically

Project description

Vestige

Vestige is a tool that automatically finds and removes commented code from python files.

For example, you can use the tool to remove some comments within an old vestige file, and output the result into another file cleaned.py like this.

python -m vestige cleaner.py --output cleaned.py

Usage

You can view the full usage with the --help option

python -m vestige --help

which yields

usage: __main__.py [-h] [--recursive] [--output OUTPUT] INPUT_PATH

Remove vestigial comments from code

positional arguments:
  INPUT_PATH            Input file or folder for cleaning

optional arguments:
  -h, --help            show this help message and exit
  --recursive, -r       Recursively search a folder and clean files underneat it
  --output OUTPUT, -o OUTPUT
                        Location to save file/files out to. If using --recursive should be a directory

Installation

To install with pip

pip install vestige-cleaner

Q/A

  • Will vestige break my code!?

Thankfully, no! Vestige only analyzes inline comments, so while it's possible for it to remove some inline documentation by mistake, it won't ever affect the actual code.

  • How much can I trust vestige?

Vestige's current model is about 95% accurate on internal tests. We recommend double checking the diff of the original and output files to ensure everything has worked properly. In the future we are aiming to increase this accuracy significantly through improvement of both the model and the training dataset.

  • How does vestige work?

Vestige uses BERT, a transformer based artificial neural network that is pretrained to better understand (kind of) language, and then fine tuned on a specific task. In this case, it is fine tuned to distinguish between commented code and useful documentation.

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

vestige-cleaner-0.0.1a4.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

vestige_cleaner-0.0.1a4-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file vestige-cleaner-0.0.1a4.tar.gz.

File metadata

  • Download URL: vestige-cleaner-0.0.1a4.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.3

File hashes

Hashes for vestige-cleaner-0.0.1a4.tar.gz
Algorithm Hash digest
SHA256 b7bcb4cf9de937f1a71d120653dcb7b1828cdee89862fc812c17fdb9f9fdb74a
MD5 415209cb1f06f95fc2f7dd208ce5c1fa
BLAKE2b-256 57cc2fe5b91c40a1cd9246a22b6d9ab4aba14928034b1c80236bb227ae29ea7a

See more details on using hashes here.

File details

Details for the file vestige_cleaner-0.0.1a4-py3-none-any.whl.

File metadata

  • Download URL: vestige_cleaner-0.0.1a4-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.3

File hashes

Hashes for vestige_cleaner-0.0.1a4-py3-none-any.whl
Algorithm Hash digest
SHA256 68b0062da1353a217d49cedd2b1052822578b7ff6e35eaf9b2babd25f64e910f
MD5 5f5d6979f25e81ddd833829a5c84199e
BLAKE2b-256 487ce2fa4a123f2454135b2b03939b6dc9c13a64810a447f2247e2d41075df14

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