A fast Rust-based CLI tool for removing comments from source code
Project description
uncomment
A blazing fast Rust-based command-line tool that removes comments from your source code. Perfect for cleaning up AI-generated code that comes with excessive explanations.
Why Use This?
- 🚀 Lightning Fast - Built in Rust for maximum performance
- 🎯 100% Accurate - Never accidentally removes code that looks like comments
- 🛡️ Safe by Default - Preview changes before applying them
- 🌍 Multi-language - Supports Python, JS, TS, Rust, Go, Java, C/C++, and more
- 🔧 Zero Dependencies - Downloads a self-contained binary
Installation
pip install uncomment
The installer will automatically download the appropriate pre-compiled Rust binary for your platform (Windows, macOS, or Linux).
Quick Start
Remove comments from a single file:
uncomment main.py
Preview changes without modifying files:
uncomment --dry-run src/
Process all Python files in a directory:
uncomment "src/**/*.py"
Key Features
Smart Comment Detection
Unlike simple regex-based tools, uncomment understands your code's structure:
# This comment will be removed
code = "# But this won't - it's in a string!"
Preserves Important Comments
Keeps what matters:
TODOandFIXMEcomments (configurable)- License headers and copyright notices
- Linting directives (
# noqa,# type: ignore, etc.) - Docstrings (configurable)
Perfect for Python Projects
- Handles all Python comment styles
- Preserves type hints and annotations
- Respects
# pylint:,# flake8:, and other linter directives - Works with
.py,.pyw,.pyi,.pyx, and.pxdfiles
Common Use Cases
Clean up AI-generated code:
uncomment generated_script.py
Remove all comments including TODOs:
uncomment --remove-todo --remove-fixme module.py
Remove docstrings:
uncomment --remove-doc api.py
Process entire packages:
uncomment my_package/
Use multiple threads for large codebases:
uncomment --threads 8 entire_project/
Supported Languages
While this tool works great for Python, it also supports: JavaScript, TypeScript, Rust, Go, Java, C/C++, Ruby, YAML, Terraform/HCL, Makefile, and more!
Documentation
For detailed documentation, advanced options, and examples, visit: https://github.com/Goldziher/uncomment
License
MIT - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uncomment-2.5.0.tar.gz.
File metadata
- Download URL: uncomment-2.5.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bb912025d0d20894361603b583a42e913de6155f736d97a533366c5d1c98b14
|
|
| MD5 |
26fe7f95fc5b3770462920fb3786eacb
|
|
| BLAKE2b-256 |
2605f619e5a200e6b6ef2a1f7f57e9468ace2bbb4763cdc7fc68ea7cebbdfc02
|
File details
Details for the file uncomment-2.5.0-py3-none-any.whl.
File metadata
- Download URL: uncomment-2.5.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b46c8481cf62cc483c5e77d75b44e0988363c873a352826a86f1ce11512d5439
|
|
| MD5 |
db2ff33b8dc7f21cd96b37ddbd0360d5
|
|
| BLAKE2b-256 |
f7111165721773250f98eeae05334ba81eec2561f6bcb3c89319aae128edb9ae
|